Skip to content

Commit a7ef777

Browse files
committed
include VERSIONS.txt in examples bundle
1 parent d4044dc commit a7ef777

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

circuitpython_build_tools/scripts/build_bundles.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ def build_bundle(libs, bundle_version, output_filename,
7676
success = False
7777

7878
print()
79-
if not example_bundle:
80-
print("Generating VERSIONS")
81-
if multiple_libs:
82-
with open(os.path.join(build_lib_dir, "VERSIONS.txt"), "w") as f:
83-
f.write(bundle_version + "\r\n")
84-
versions = subprocess.run('git submodule foreach \"git remote get-url origin && git describe --tags\"', shell=True, stdout=subprocess.PIPE)
85-
if versions.returncode != 0:
86-
print("Failed to generate versions file. Its likely a library hasn't been "
87-
"released yet.")
88-
success = False
89-
90-
repo = None
91-
for line in versions.stdout.split(b"\n"):
92-
if line.startswith(b"Entering") or not line:
93-
continue
94-
if line.startswith(b"git@"):
95-
repo = b"https://github.com/" + line.split(b":")[1][:-len(".git")]
96-
elif line.startswith(b"https:"):
97-
repo = line.strip()[:-len(".git")]
98-
else:
99-
f.write(repo.decode("utf-8", "strict") + "/releases/tag/" + line.strip().decode("utf-8", "strict") + "\r\n")
79+
print("Generating VERSIONS")
80+
if multiple_libs:
81+
print(os.path.commonpath(libs))
82+
with open(os.path.join(build_dir, build_dir.replace(".zip", ""), "VERSIONS.txt"), "w") as f:
83+
f.write(bundle_version + "\r\n")
84+
versions = subprocess.run('git submodule foreach \"git remote get-url origin && git describe --tags\"', shell=True, stdout=subprocess.PIPE)
85+
if versions.returncode != 0:
86+
print("Failed to generate versions file. Its likely a library hasn't been "
87+
"released yet.")
88+
success = False
89+
90+
repo = None
91+
for line in versions.stdout.split(b"\n"):
92+
if line.startswith(b"Entering") or not line:
93+
continue
94+
if line.startswith(b"git@"):
95+
repo = b"https://github.com/" + line.split(b":")[1][:-len(".git")]
96+
elif line.startswith(b"https:"):
97+
repo = line.strip()[:-len(".git")]
98+
else:
99+
f.write(repo.decode("utf-8", "strict") + "/releases/tag/" + line.strip().decode("utf-8", "strict") + "\r\n")
100100

101101
if not success:
102102
print("WARNING: some failures above")

0 commit comments

Comments
 (0)