🔨 Fix Windows/ReARM upload (#27872)

This commit is contained in:
ellensp 2025-05-25 09:53:52 +12:00 committed by GitHub
parent d76c8c1fbd
commit 4f93f31af0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,18 +54,25 @@ if pioutil.is_pio_build():
final_drive_name = drive + ':'
# print ('disc check: {}'.format(final_drive_name))
try:
volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
volume_info = str(subprocess.check_output('cmd /C vol ' + final_drive_name, stderr=subprocess.STDOUT))
except Exception as e:
print ('error:{}'.format(e))
continue
else:
if target_drive in volume_info and not target_file_found: # set upload if not found target file yet
target_drive_found = True
if target_drive in volume_info: # set upload
upload_disk = PureWindowsPath(final_drive_name)
if target_filename in volume_info:
if not target_file_found:
target_drive_found = True
break
try:
dir_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
except Exception as e:
print ('error:{}'.format(e))
continue
else:
if target_filename in dir_info:
upload_disk = PureWindowsPath(final_drive_name)
target_file_found = True
target_file_found = True
break
elif current_OS == 'Linux':
#