Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit ab916a9

Browse files
Shenfqgregberge
authored andcommitted
fix(windows): cd must run the specified drive letter (#252)
1 parent fb39d5c commit ab916a9

File tree

1 file changed

+8
-0
lines changed
  • packages/ssh-pool/src/commands

1 file changed

+8
-0
lines changed

packages/ssh-pool/src/commands/cd.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
import path from 'path'
12
import { joinCommandArgs, requireArgs } from './util'
23

4+
const isWin = /^win/.test(process.platform)
5+
36
export function formatCdCommand({ folder }) {
47
requireArgs(['folder'], { folder }, 'cd')
58
const args = ['cd', folder]
9+
const { root } = path.parse(folder)
10+
const drive = root.replace(path.sep, '')
11+
if (isWin && root !== '/') {
12+
args.push(`&& ${drive}`)
13+
}
614
return joinCommandArgs(args)
715
}

0 commit comments

Comments
 (0)