We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 763d61e commit b39d328Copy full SHA for b39d328
tools/get_idf_ver.py
@@ -0,0 +1,25 @@
1
+import argparse
2
+import os
3
+import re
4
+import sys
5
+
6
+def main(ver_file_path):
7
+ with open(ver_file_path, encoding="utf8") as fp:
8
+ pattern = r"set\(IDF_VERSION_(MAJOR|MINOR|PATCH) (\d+)\)"
9
+ matches = re.findall(pattern, fp.read())
10
+ idf_version = str(".".join([match[1] for match in matches]))
11
+ os.environ["IDF_VERSION"] = idf_version
12
+ return idf_version
13
14
+if __name__ == "__main__":
15
+ parser = argparse.ArgumentParser()
16
+ parser.add_argument(
17
+ "-p",
18
+ "--path",
19
+ dest="ver_file_path",
20
+ required=True,
21
+ help="Full path to the ESP-IDF cmake version file \"version.cmake\"",
22
+ )
23
+ args = parser.parse_args()
24
25
+ sys.exit(main(args.ver_file_path))
0 commit comments