Skip to content

Commit e90a634

Browse files
authored
fix: cd is not working on windows (#48)
1 parent 0ff2b77 commit e90a634

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ exports.makeEnv = makeEnv
55

66
const spawn = require('./lib/spawn')
77
const { execute } = require('@yarnpkg/shell')
8+
const { npath } = require('@yarnpkg/fslib')
89
const path = require('path')
910
const Stream = require('stream').Stream
1011
const fs = require('fs')
@@ -246,7 +247,7 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) {
246247
opts.log.silly('lifecycle', logid(pkg, stage), 'Args:', [shFlag, cmd])
247248

248249
if (opts.shellEmulator) {
249-
const execOpts = { cwd: wd, env }
250+
const execOpts = { cwd: npath.toPortablePath(wd), env }
250251
if (opts.stdio === 'pipe') {
251252
const stdout = new PassThrough()
252253
const stderr = new PassThrough()

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"dependencies": {
3535
"@pnpm/byline": "^1.0.0",
3636
"@pnpm/error": "^1000.0.2",
37+
"@yarnpkg/fslib": "^3.0.0",
3738
"@yarnpkg/shell": "4.0.0",
3839
"node-gyp": "^11.1.0",
3940
"resolve-from": "^5.0.0",

0 commit comments

Comments
 (0)