From 261b32ade7b5b7197ccd6a1513f72bba27ce5959 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:29:20 +0200 Subject: [PATCH] fix: use yarn instead of npx with yarn.lock (#914) Co-authored-by: Stokes Player <1702361+warrensplayer@users.noreply.github.com> --- dist/index.js | 10 ++++++---- index.js | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9c46b946e..b333a0be2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 @@ -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 ) @@ -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 ) diff --git a/index.js b/index.js index 81311a294..529024748 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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 ) @@ -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 )