Skip to content

Commit 624c943

Browse files
committed
Allow version script to be called from any directory
1 parent 6e91327 commit 624c943

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build-support/gen-pulsar-version-macro.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
# under the License.
1919
#
2020

21-
import re, sys
21+
import re, sys, os
2222

23-
version = open("version.txt").read()
23+
dirname = os.path.abspath(os.path.dirname(sys.argv[0]))
24+
version_file = os.path.join(dirname, "..", "version.txt")
25+
version = open(version_file).read()
2426
m = re.search(r'^(\d+)\.(\d+)\.(\d+)', version)
2527

2628
version_macro = 0

0 commit comments

Comments
 (0)