Skip to content

Commit c963213

Browse files
committed
fix paths
1 parent fc2831c commit c963213

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/get.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,18 @@ def is_latest_version(filename, destination, dirname, rename_to, cfile):
160160
if rename_to.startswith("esp32-arduino-libs"):
161161
# overwrite expected_version with the one from versions.txt
162162
if filename.endswith("tar.gz") or filename.endswith("tar.xz"):
163-
expected_version = cfile.extractfile(os.path.join(dirname, "versions.txt")).read().decode("utf-8")
163+
expected_version = cfile.extractfile(dirname + "/versions.txt").read().decode("utf-8")
164164
else:
165-
expected_version = cfile.read(os.path.join(dirname, "versions.txt")).decode("utf-8")
165+
expected_version = cfile.read(dirname + "/versions.txt").decode("utf-8")
166166
with open(os.path.join(destination, rename_to, "versions.txt"), "r") as f:
167167
# cfile is zip
168168
current_version = f.read()
169169
elif rename_to.startswith("mklittlefs"):
170170
# overwrite expected_version with the one from package.json
171171
if filename.endswith("tar.gz") or filename.endswith("tar.xz"):
172-
expected_version = cfile.extractfile(os.path.join(dirname, "package.json")).read().decode("utf-8")
172+
expected_version = cfile.extractfile(dirname + "/package.json").read().decode("utf-8")
173173
else:
174-
expected_version = cfile.read(os.path.join(dirname, "package.json")).decode("utf-8")
174+
expected_version = cfile.read(dirname + "/package.json").decode("utf-8")
175175
with open(os.path.join(destination, rename_to, "package.json"), "r") as f:
176176
# cfile is tar.gz
177177
current_version = f.read()
@@ -181,15 +181,15 @@ def is_latest_version(filename, destination, dirname, rename_to, cfile):
181181
current_version = re.search(regex, result.stdout).group(1)
182182
else:
183183
if rename_to.startswith("xtensa-esp-elf-gdb"):
184-
bin_path = os.path.join(destination, rename_to, "bin/xtensa-esp32-elf-gdb")
184+
bin_path = os.path.join(destination, rename_to, "bin", "xtensa-esp32-elf-gdb")
185185
elif rename_to.startswith("riscv32-esp-elf-gdb"):
186-
bin_path = os.path.join(destination, rename_to, "bin/riscv32-esp-elf-gdb")
186+
bin_path = os.path.join(destination, rename_to, "bin", "riscv32-esp-elf-gdb")
187187
elif rename_to.startswith("openocd"):
188-
bin_path = os.path.join(destination, rename_to, "bin/openocd")
188+
bin_path = os.path.join(destination, rename_to, "bin", "openocd")
189189
elif rename_to.startswith("mkspiffs"):
190190
bin_path = os.path.join(destination, rename_to, "mkspiffs")
191191
else:
192-
bin_path = os.path.join(destination, rename_to, "bin/" + rename_to + "-gcc")
192+
bin_path = os.path.join(destination, rename_to, "bin", rename_to + "-gcc")
193193

194194
result = subprocess.run([bin_path, "--version"], text=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
195195
current_version = re.search(regex, result.stdout).group(1)

0 commit comments

Comments
 (0)