Skip to content

Commit

Permalink
test(exec): windows test case failed
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 committed Feb 13, 2022
1 parent 2f1af64 commit daebed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-commands-script-runners/src/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The shell should understand the -c switch on UNIX or /d /s /c on Windows.',
},
],
url: docsUrl('exec'),
usages: ['pnpm [-r] [--shell-mode] exec <command> [args...]'],
usages: ['pnpm [-r] [-c] exec <command> [args...]'],
})
}

Expand Down
5 changes: 4 additions & 1 deletion packages/plugin-commands-script-runners/test/exec.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { promises as fs } from 'fs'
import os from 'os'
import path from 'path'
import PnpmError from '@pnpm/error'
import { readProjects } from '@pnpm/filter-workspace-packages'
Expand Down Expand Up @@ -417,6 +418,8 @@ test('pnpm exec outside of projects', async () => {
test('pnpm exec shell mode', async () => {
prepareEmpty()

const echoArgs = os.platform() === 'win32' ? '%PNPM_PACKAGE_NAME% > name.txt' : '$PNPM_PACKAGE_NAME > name.txt'

await exec.handler({
...DEFAULT_OPTS,
dir: process.cwd(),
Expand All @@ -434,7 +437,7 @@ test('pnpm exec shell mode', async () => {
},
},
shellMode: true,
}, ['echo', '$PNPM_PACKAGE_NAME > name.txt'])
}, ['echo', echoArgs])

const result = (await fs.readFile(path.resolve('name.txt'), 'utf8')).trim()

Expand Down

0 comments on commit daebed5

Please sign in to comment.