Skip to content

Commit

Permalink
fix: use yarn instead of npx with yarn.lock (cypress-io#914)
Browse files Browse the repository at this point in the history
Co-authored-by: Stokes Player <1702361+warrensplayer@users.noreply.github.com>
  • Loading branch information
MikeMcC399 and warrensplayer committed Jul 16, 2023
1 parent 7ad5be0 commit 807b15e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions dist/index.js
Expand Up @@ -74457,6 +74457,8 @@ const useYarn = () => fs.existsSync(yarnFilename)
const usePnpm = () => fs.existsSync(pnpmLockFilename)
const useNpm = () => fs.existsSync(packageLockFilename)

const runPrefix = useYarn() ? 'yarn' : 'npx'

const lockHash = () => {
const lockFilename = useYarn()
? yarnFilename
Expand Down Expand Up @@ -74635,9 +74637,9 @@ const listCypressBinaries = () => {
}

core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
return io.which('npx', true).then((npxPath) => {
return io.which(runPrefix, true).then((runPath) => {
return exec.exec(
quote(npxPath),
quote(runPath),
['cypress', 'cache', 'list'],
cypressCommandOptions
)
Expand All @@ -74654,9 +74656,9 @@ const verifyCypressBinary = () => {
}

core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
return io.which('npx', true).then((npxPath) => {
return io.which(runPrefix, true).then((runPath) => {
return exec.exec(
quote(npxPath),
quote(runPath),
['cypress', 'verify'],
cypressCommandOptions
)
Expand Down
10 changes: 6 additions & 4 deletions index.js
Expand Up @@ -106,6 +106,8 @@ const useYarn = () => fs.existsSync(yarnFilename)
const usePnpm = () => fs.existsSync(pnpmLockFilename)
const useNpm = () => fs.existsSync(packageLockFilename)

const runPrefix = useYarn() ? 'yarn' : 'npx'

const lockHash = () => {
const lockFilename = useYarn()
? yarnFilename
Expand Down Expand Up @@ -284,9 +286,9 @@ const listCypressBinaries = () => {
}

core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
return io.which('npx', true).then((npxPath) => {
return io.which(runPrefix, true).then((runPath) => {
return exec.exec(
quote(npxPath),
quote(runPath),
['cypress', 'cache', 'list'],
cypressCommandOptions
)
Expand All @@ -303,9 +305,9 @@ const verifyCypressBinary = () => {
}

core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
return io.which('npx', true).then((npxPath) => {
return io.which(runPrefix, true).then((runPath) => {
return exec.exec(
quote(npxPath),
quote(runPath),
['cypress', 'verify'],
cypressCommandOptions
)
Expand Down

0 comments on commit 807b15e

Please sign in to comment.