Skip to content

Commit e08da49

Browse files
fix: use yarn instead of npx with yarn.lock (#914)
Co-authored-by: Stokes Player <[email protected]>
1 parent c3b451e commit e08da49

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

dist/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74457,6 +74457,8 @@ const useYarn = () => fs.existsSync(yarnFilename)
7445774457
const usePnpm = () => fs.existsSync(pnpmLockFilename)
7445874458
const useNpm = () => fs.existsSync(packageLockFilename)
7445974459

74460+
const runPrefix = useYarn() ? 'yarn' : 'npx'
74461+
7446074462
const lockHash = () => {
7446174463
const lockFilename = useYarn()
7446274464
? yarnFilename
@@ -74635,9 +74637,9 @@ const listCypressBinaries = () => {
7463574637
}
7463674638

7463774639
core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
74638-
return io.which('npx', true).then((npxPath) => {
74640+
return io.which(runPrefix, true).then((runPath) => {
7463974641
return exec.exec(
74640-
quote(npxPath),
74642+
quote(runPath),
7464174643
['cypress', 'cache', 'list'],
7464274644
cypressCommandOptions
7464374645
)
@@ -74654,9 +74656,9 @@ const verifyCypressBinary = () => {
7465474656
}
7465574657

7465674658
core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
74657-
return io.which('npx', true).then((npxPath) => {
74659+
return io.which(runPrefix, true).then((runPath) => {
7465874660
return exec.exec(
74659-
quote(npxPath),
74661+
quote(runPath),
7466074662
['cypress', 'verify'],
7466174663
cypressCommandOptions
7466274664
)

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ const useYarn = () => fs.existsSync(yarnFilename)
106106
const usePnpm = () => fs.existsSync(pnpmLockFilename)
107107
const useNpm = () => fs.existsSync(packageLockFilename)
108108

109+
const runPrefix = useYarn() ? 'yarn' : 'npx'
110+
109111
const lockHash = () => {
110112
const lockFilename = useYarn()
111113
? yarnFilename
@@ -284,9 +286,9 @@ const listCypressBinaries = () => {
284286
}
285287

286288
core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
287-
return io.which('npx', true).then((npxPath) => {
289+
return io.which(runPrefix, true).then((runPath) => {
288290
return exec.exec(
289-
quote(npxPath),
291+
quote(runPath),
290292
['cypress', 'cache', 'list'],
291293
cypressCommandOptions
292294
)
@@ -303,9 +305,9 @@ const verifyCypressBinary = () => {
303305
}
304306

305307
core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
306-
return io.which('npx', true).then((npxPath) => {
308+
return io.which(runPrefix, true).then((runPath) => {
307309
return exec.exec(
308-
quote(npxPath),
310+
quote(runPath),
309311
['cypress', 'verify'],
310312
cypressCommandOptions
311313
)

0 commit comments

Comments
 (0)