@@ -160,18 +160,18 @@ def is_latest_version(filename, destination, dirname, rename_to, cfile):
160
160
if rename_to .startswith ("esp32-arduino-libs" ):
161
161
# overwrite expected_version with the one from versions.txt
162
162
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" )
164
164
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" )
166
166
with open (os .path .join (destination , rename_to , "versions.txt" ), "r" ) as f :
167
167
# cfile is zip
168
168
current_version = f .read ()
169
169
elif rename_to .startswith ("mklittlefs" ):
170
170
# overwrite expected_version with the one from package.json
171
171
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" )
173
173
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" )
175
175
with open (os .path .join (destination , rename_to , "package.json" ), "r" ) as f :
176
176
# cfile is tar.gz
177
177
current_version = f .read ()
@@ -181,15 +181,15 @@ def is_latest_version(filename, destination, dirname, rename_to, cfile):
181
181
current_version = re .search (regex , result .stdout ).group (1 )
182
182
else :
183
183
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" )
185
185
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" )
187
187
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" )
189
189
elif rename_to .startswith ("mkspiffs" ):
190
190
bin_path = os .path .join (destination , rename_to , "mkspiffs" )
191
191
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" )
193
193
194
194
result = subprocess .run ([bin_path , "--version" ], text = True , check = True , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
195
195
current_version = re .search (regex , result .stdout ).group (1 )
0 commit comments