fix: use backslash path separator for DOS paths
Build & Deploy / build-and-deploy (push) Successful in 49s
Build & Deploy / build-and-deploy (push) Successful in 49s
extractDir.relativize() returns paths with native Linux forward
slashes. DOS requires backslashes. Changed .replace('\', '/')
to .replace('/', '\') and updated buildDosboxConf split logic
to also check for backslash separator.
This commit is contained in:
@@ -88,7 +88,7 @@ public class UploadResource {
|
||||
// Write dosbox.conf (full config, not just autoexec)
|
||||
Path jsdos = gameDir.resolve(".jsdos");
|
||||
Files.createDirectories(jsdos);
|
||||
String relExe = extractDir.relativize(Path.of(mainExe)).toString().replace('\\', '/');
|
||||
String relExe = extractDir.relativize(Path.of(mainExe)).toString().replace('/', '\\');
|
||||
String conf = buildDosboxConf(relExe);
|
||||
Files.writeString(jsdos.resolve("dosbox.conf"), conf);
|
||||
Files.write(jsdos.resolve("jsdos.json"), buildJsdosJson(relExe));
|
||||
@@ -216,7 +216,7 @@ public class UploadResource {
|
||||
// Create .jsdos config (full config, not just autoexec)
|
||||
Path jsdos = tmpBundle.resolve(".jsdos");
|
||||
Files.createDirectories(jsdos);
|
||||
String relExe = extractDir.relativize(Path.of(mainExe)).toString().replace('\\', '/');
|
||||
String relExe = extractDir.relativize(Path.of(mainExe)).toString().replace('/', '\\');
|
||||
String conf = buildDosboxConf(relExe);
|
||||
Files.writeString(jsdos.resolve("dosbox.conf"), conf);
|
||||
Files.write(jsdos.resolve("jsdos.json"), buildJsdosJson(relExe));
|
||||
@@ -274,7 +274,7 @@ public class UploadResource {
|
||||
// Split into directory and executable components for subdirectory support
|
||||
String dir = "";
|
||||
String exe = relExe;
|
||||
int idx = relExe.lastIndexOf('/');
|
||||
int idx = Math.max(relExe.lastIndexOf('/'), relExe.lastIndexOf('\\'));
|
||||
if (idx >= 0) {
|
||||
dir = relExe.substring(0, idx);
|
||||
exe = relExe.substring(idx + 1);
|
||||
|
||||
Reference in New Issue
Block a user