MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / main

Function main

Buildscripts/release-sdk-current.py:20–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 return None
19
20def main():
21 # 1. Get idf_target
22 idf_target = get_idf_target()
23 if not idf_target:
24 print("Could not determine IDF target from sdkconfig")
25 sys.exit(1)
26
27 # 2. Get version
28 try:
29 with open("version.txt", "r") as f:
30 version = f.read().strip()
31 except FileNotFoundError:
32 print("version.txt not found")
33 sys.exit(1)
34
35 # 3. Construct sdk_path
36 # release/TactilitySDK/${version}-${idf_target}/TactilitySDK
37 sdk_path = os.path.join("release", "TactilitySDK", f"{version}-{idf_target}", "TactilitySDK")
38
39 # 4. Cleanup sdk_path
40 if os.path.exists(sdk_path):
41 print(f"Cleaning up {sdk_path}")
42 shutil.rmtree(sdk_path)
43
44 os.makedirs(sdk_path, exist_ok=True)
45
46 # 5. Call release-sdk.py
47 # Note: Using sys.executable to ensure we use the same python interpreter
48 script_path = os.path.join("Buildscripts", "release-sdk.py")
49 print(f"Running {script_path} {sdk_path}")
50
51 result = subprocess.run([sys.executable, script_path, sdk_path])
52
53 if result.returncode != 0:
54 print(f"Error: {script_path} failed with return code {result.returncode}")
55 sys.exit(result.returncode)
56
57if __name__ == "__main__":
58 main()

Callers 1

Calls 6

get_idf_targetFunction · 0.85
openFunction · 0.85
joinMethod · 0.80
existsMethod · 0.80
runMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected