diff --git a/packages/link-bins/package.json b/packages/link-bins/package.json index 8e9a16d87a..4dcd023c3e 100644 --- a/packages/link-bins/package.json +++ b/packages/link-bins/package.json @@ -52,6 +52,7 @@ "@types/node": "^14.14.33", "@types/normalize-path": "^3.0.0", "@types/ramda": "0.27.39", + "cmd-extension": "^1.0.2", "ncp": "^2.0.0", "path-exists": "^4.0.0", "tempy": "^1.0.0" diff --git a/packages/link-bins/test/index.ts b/packages/link-bins/test/index.ts index fa8811970d..fef05d1a31 100644 --- a/packages/link-bins/test/index.ts +++ b/packages/link-bins/test/index.ts @@ -5,6 +5,7 @@ import path from 'path' import linkBins, { linkBinsOfPackages, } from '@pnpm/link-bins' +import CMD_EXTENSION from 'cmd-extension' import isWindows from 'is-windows' import ncpcb from 'ncp' import normalizePath from 'normalize-path' @@ -33,7 +34,7 @@ function getExpectedBins (bins: string[]) { bins.forEach((bin) => expectedBins.push(`${bin}.ps1`)) } if (IS_WINDOWS) { - bins.forEach((bin) => expectedBins.push(`${bin}.cmd`)) + bins.forEach((bin) => expectedBins.push(`${bin}${CMD_EXTENSION}`)) } return expectedBins.sort() } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac46cf1b33..c2df0fe8bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -982,6 +982,7 @@ importers: '@types/normalize-path': ^3.0.0 '@types/ramda': 0.27.39 '@zkochan/cmd-shim': ^5.2.1 + cmd-extension: ^1.0.2 is-subdir: ^1.1.1 is-windows: ^1.0.2 ncp: ^2.0.0 @@ -1011,6 +1012,7 @@ importers: '@types/node': 14.17.19 '@types/normalize-path': 3.0.0 '@types/ramda': 0.27.39 + cmd-extension: 1.0.2 ncp: 2.0.0 path-exists: 4.0.0 tempy: 1.0.1 @@ -6739,7 +6741,6 @@ packages: /cmd-extension/1.0.2: resolution: {integrity: sha512-iWDjmP8kvsMdBmLTHxFaqXikO8EdFRDfim7k6vUHglY/2xJ5jLrPsnQGijdfp4U+sr/BeecG0wKm02dSIAeQ1g==} engines: {node: '>=10'} - dev: false /co/4.6.0: resolution: {integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=}