Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-07-16 21:47:53 +0300
committerGitHub <noreply@github.com>2022-07-16 21:47:53 +0300
commit0c0a5c00baa29c0e18287d36bc47a50d6abaaa1e (patch)
tree3c0e5f3dca5fae9fdb904f7d6100b7b1708e2350 /generator
parentc623e7443500175296f1139c53758afb3a58f410 (diff)
parent9d13556c85508a77900aacf003d80545a22b5433 (diff)
Merge pull request #500 from silvergasp/master
Add bazel rules for nanopb generation
Diffstat (limited to 'generator')
-rwxr-xr-xgenerator/protoc-gen-nanopb14
1 files changed, 6 insertions, 8 deletions
diff --git a/generator/protoc-gen-nanopb b/generator/protoc-gen-nanopb
index 471a620..20a36c7 100755
--- a/generator/protoc-gen-nanopb
+++ b/generator/protoc-gen-nanopb
@@ -1,13 +1,11 @@
-#!/bin/sh
-
+#!/usr/bin/env python3
# This file is used to invoke nanopb_generator.py as a plugin
# to protoc on Linux and other *nix-style systems.
# Use it like this:
# protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb --nanopb_out=dir foo.proto
-#
-# Note that if you use the binary package of nanopb, the protoc
-# path is already set up properly and there is no need to give
-# --plugin= on the command line.
-MYPATH=$(dirname "$0")
-exec "$MYPATH/nanopb_generator.py" --protoc-plugin
+from nanopb_generator import *
+
+if __name__ == '__main__':
+ # Assume we are running as a plugin under protoc.
+ main_plugin()