-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up dep-installer logic and split yarn out
- Loading branch information
Showing
4 changed files
with
119 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import path from 'path' | ||
import tempDir from 'temp-dir' | ||
|
||
export function getYarnCommand (opts: { | ||
yarnV311: boolean | ||
updateYarnLock: boolean | ||
isCI: boolean | ||
runScripts: boolean | ||
}): string { | ||
let cmd = `yarn install` | ||
|
||
if (opts.yarnV311) { | ||
// @see https://yarnpkg.com/cli/install | ||
if (!opts.runScripts) cmd += ' --mode=skip-build' | ||
|
||
if (!opts.updateYarnLock) cmd += ' --immutable' | ||
|
||
return cmd | ||
} | ||
|
||
cmd += ' --prefer-offline' | ||
|
||
if (!opts.runScripts) cmd += ' --ignore-scripts' | ||
|
||
if (!opts.updateYarnLock) cmd += ' --frozen-lockfile' | ||
|
||
// yarn v1 has a bug with integrity checking and local cache/dependencies | ||
// @see https://github.com/yarnpkg/yarn/issues/6407 | ||
cmd += ' --update-checksums' | ||
|
||
// in CircleCI, this offline cache can be used | ||
if (opts.isCI) cmd += ` --cache-folder=~/.yarn-${process.platform} ` | ||
else cmd += ` --cache-folder=${path.join(tempDir, 'cy-system-tests-yarn-cache', String(Date.now()))}` | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters