summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 19:15:34 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 19:15:34 +0200
commit08391f35eeeac9583c9ae5010e5e37ca2a5bc0a4 (patch)
treeeed6a8a096327efbfcddd089989284c1c958ca99 /tools
parent3aaa4ad8c290af87d9bb9e24447f9cd6f9a79eab (diff)
Add nanopb version number to generated files.
tools/set_version.sh is used to update the values. Update issue 36 Status: FixedInGit
Diffstat (limited to 'tools')
-rwxr-xr-xtools/set_version.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/set_version.sh b/tools/set_version.sh
new file mode 100755
index 00000000..e15a859d
--- /dev/null
+++ b/tools/set_version.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Run this from the top directory of nanopb tree.
+# e.g. user@localhost:~/nanopb$ tools/set_version.sh nanopb-0.1.9-dev
+# It sets the version number in pb.h and generator/nanopb_generator.py.
+
+sed -i -e 's/nanopb_version\s*=\s*"[^"]*"/nanopb_version = "'$1'"/' generator/nanopb_generator.py
+sed -i -e 's/#define\s*NANOPB_VERSION\s*.*/#define NANOPB_VERSION '$1'/' pb.h
+
+