console updater does not work if folder name contains spaces fix #3927

This commit is contained in:
rusefillc 2022-02-12 10:42:31 -05:00
parent 94603363d9
commit 27af540ba2
2 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,8 @@ All notable user-facing or behavior-altering changes will be documented in this
### Fixed
- SD card logging with SDIO hardware #3873
- rusEFI console stability improvement #3912
- rusEFI console stability improvement #3912
- console updater does not work if folder name contains spaces #3927
## Removed
- Miata NB1 trigger was merged with Miata NB2 trigger

View File

@ -178,11 +178,16 @@ public class DfuFlasher {
String hexFileName = IniFileModel.findFile(Launcher.INPUT_FILES_PATH, prefix, suffix);
if (hexFileName == null)
throw new FileNotFoundException("File not found " + prefix + "*" + suffix);
String hexAbsolutePath = new File(hexFileName).getAbsolutePath();
// we need quotes in case if absolute path contains spaces
String hexAbsolutePath = quote(new File(hexFileName).getAbsolutePath());
return DFU_BINARY_LOCATION + "/" + DFU_BINARY + " -c port=usb1 -w " + hexAbsolutePath + " -v -s";
}
private static String quote(String absolutePath) {
return "\"" + absolutePath + "\"";
}
private static String getDfuEraseCommand() {
return DFU_BINARY_LOCATION + "/" + DFU_BINARY + " -c port=usb1 -e all";
}