Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
🏁 Fix switching drive commands on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
GitSquared committed Feb 19, 2019
1 parent d520f7e commit b0bc79d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/classes/filesystem.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,11 @@ class FilesystemDisplay {
} else if (e.type === "up") {
cmd = `window.term[window.currentTerm].writelr('cd ..')`;
} else if (e.type === "disk" || e.type === "rom" || e.type === "usb") {
let extraSwitch = (process.platform === "win32") ? " /D" : "";
cmd = `window.term[window.currentTerm].writelr('cd${extraSwitch} \\'${e.path.replace(/\\/g, "\\\\")}\\'')`;
if (process.platform === "win32") {
cmd = `window.term[window.currentTerm].writelr('${e.path.replace(/\\/g, "\\\\")}')`;
} else {
cmd = `window.term[window.currentTerm].writelr('cd \\'${e.path.replace(/\\/g, "\\\\")}\\'')`;
}
} else {
cmd = `window.term[window.currentTerm].write('\\'${e.name}\\'')`;
}
Expand Down

0 comments on commit b0bc79d

Please sign in to comment.