Skip to content

Commit 4eca8ad

Browse files
fix(yarn): add --frozen-lockfile to default install command
Backport of PR #301 to 0.10.x branch. - Fix typo: --frozenlockfile -> --frozen-lockfile in installer script - Add --frozen-lockfile to default yarn install command This ensures builds fail if package.json and yarn.lock are out of sync, rather than silently updating the lockfile. Co-authored-by: Ona <no-reply@ona.com>
1 parent a926587 commit 4eca8ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/leeway/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ cp $DIR/installer-package.json package.json
10161016
$DIR/get_yarn_lock.sh > yarn.lock
10171017
10181018
mkdir -p _temp_yarn_cache
1019-
yarn install --frozenlockfile --prod --cache-folder _temp_yarn_cache
1019+
yarn install --frozen-lockfile --prod --cache-folder _temp_yarn_cache
10201020
rm -r yarn.lock _temp_yarn_cache
10211021
`
10221022

@@ -1192,7 +1192,7 @@ func (p *Package) buildYarn(buildctx *buildContext, wd, result string) (bld *pac
11921192
}
11931193
yarnCache := filepath.Join(buildctx.BuildDir(), fmt.Sprintf("yarn-cache-%s", buildctx.buildID))
11941194
if len(cfg.Commands.Install) == 0 {
1195-
commands[PackageBuildPhasePull] = append(commands[PackageBuildPhasePull], []string{"yarn", "install", "--mutex", yarnMutex, "--cache-folder", yarnCache})
1195+
commands[PackageBuildPhasePull] = append(commands[PackageBuildPhasePull], []string{"yarn", "install", "--frozen-lockfile", "--mutex", yarnMutex, "--cache-folder", yarnCache})
11961196
} else {
11971197
commands[PackageBuildPhasePull] = append(commands[PackageBuildPhasePull], cfg.Commands.Install)
11981198
}

0 commit comments

Comments
 (0)