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

Commit

Permalink
fix(windows): cd must run the specified drive letter (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shenfq authored and gregberge committed Sep 27, 2019
1 parent fb39d5c commit ab916a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/ssh-pool/src/commands/cd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import path from 'path'
import { joinCommandArgs, requireArgs } from './util'

const isWin = /^win/.test(process.platform)

export function formatCdCommand({ folder }) {
requireArgs(['folder'], { folder }, 'cd')
const args = ['cd', folder]
const { root } = path.parse(folder)
const drive = root.replace(path.sep, '')
if (isWin && root !== '/') {
args.push(`&& ${drive}`)
}
return joinCommandArgs(args)
}

0 comments on commit ab916a9

Please sign in to comment.