mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: fix cd command in powershell
This commit is contained in:
+6
-1
@@ -28,11 +28,16 @@ const transformCdCommand = (command: string) => {
|
||||
return `cd '${path.replace(/'/g, '\\\'')}'`
|
||||
}
|
||||
|
||||
const shell = getShell()
|
||||
// transform path for WSL shell.
|
||||
if (getShell().indexOf('wsl.exe') > -1) {
|
||||
if (shell.endsWith('wsl.exe')) {
|
||||
return `cd '${toWslPath(path).replace(/'/g, '\\\'')}'`
|
||||
}
|
||||
|
||||
if (shell.endsWith('powershell.exe')) {
|
||||
return `cd '${path}'\n`
|
||||
}
|
||||
|
||||
// change dir for Windows.
|
||||
return `cd /d "${path}"\r`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user