Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Jul 27, 2022
1 parent 0ec9869 commit cdfab3d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
21 changes: 11 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74706,21 +74706,22 @@ const yarnFilename = path.join(
findYarnWorkspaceRoot(workingDirectory) || workingDirectory,
'yarn.lock'
)
const pnpmLockFilename = path.join(
workingDirectory,
'pnpm-lock.yaml'
)
const pnpmLockFilename = path.join(workingDirectory, 'pnpm-lock.yaml')
const packageLockFilename = path.join(
workingDirectory,
'package-lock.json'
)

const useYarn = () => fs.existsSync(yarnFilename)

const usePnpm = () => fs.existsSync(pnpmLockFilename);
const usePnpm = () => fs.existsSync(pnpmLockFilename)

const lockHash = () => {
const lockFilename = useYarn() ? yarnFilename : (usePnpm() ? pnpmLockFilename : packageLockFilename)
const lockFilename = useYarn()
? yarnFilename
: usePnpm()
? pnpmLockFilename
: packageLockFilename
const fileHash = hasha.fromFileSync(lockFilename)
debug(`Hash from file ${lockFilename} is ${fileHash}`)
return fileHash
Expand All @@ -74735,7 +74736,7 @@ const getNpmCache = () => {
if (!key) {
if (useYarn()) {
key = `yarn-${platformAndArch}-${hash}`
} if (usePnpm()) {
} else if (usePnpm()) {
key = `pnpm-${platformAndArch}-${hash}`
} else {
key = `npm-${platformAndArch}-${hash}`
Expand Down Expand Up @@ -74857,9 +74858,9 @@ const install = () => {
return io.which('pnpm', true).then((pnpmPath) => {
debug(`pnpm at "${pnpmPath}"`)
return exec.exec(
quote(pnpmPath),
['install', '--frozen-lockfile'],
cypressCommandOptions
quote(pnpmPath),
['install', '--frozen-lockfile'],
cypressCommandOptions
)
})
} else {
Expand Down
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,22 @@ const yarnFilename = path.join(
findYarnWorkspaceRoot(workingDirectory) || workingDirectory,
'yarn.lock'
)
const pnpmLockFilename = path.join(
workingDirectory,
'pnpm-lock.yaml'
)
const pnpmLockFilename = path.join(workingDirectory, 'pnpm-lock.yaml')
const packageLockFilename = path.join(
workingDirectory,
'package-lock.json'
)

const useYarn = () => fs.existsSync(yarnFilename)

const usePnpm = () => fs.existsSync(pnpmLockFilename);
const usePnpm = () => fs.existsSync(pnpmLockFilename)

const lockHash = () => {
const lockFilename = useYarn() ? yarnFilename : (usePnpm() ? pnpmLockFilename : packageLockFilename)
const lockFilename = useYarn()
? yarnFilename
: usePnpm()
? pnpmLockFilename
: packageLockFilename
const fileHash = hasha.fromFileSync(lockFilename)
debug(`Hash from file ${lockFilename} is ${fileHash}`)
return fileHash
Expand All @@ -125,7 +126,7 @@ const getNpmCache = () => {
if (!key) {
if (useYarn()) {
key = `yarn-${platformAndArch}-${hash}`
} if (usePnpm()) {
} else if (usePnpm()) {
key = `pnpm-${platformAndArch}-${hash}`
} else {
key = `npm-${platformAndArch}-${hash}`
Expand Down Expand Up @@ -247,9 +248,9 @@ const install = () => {
return io.which('pnpm', true).then((pnpmPath) => {
debug(`pnpm at "${pnpmPath}"`)
return exec.exec(
quote(pnpmPath),
['install', '--frozen-lockfile'],
cypressCommandOptions
quote(pnpmPath),
['install', '--frozen-lockfile'],
cypressCommandOptions
)
})
} else {
Expand Down

0 comments on commit cdfab3d

Please sign in to comment.