DEV: Pass through --frozen-lockfile flag for yarn install (#17478)

`--production` is already passed through via the `NODE_ENV` environment variable. We can parse `$npm_config_argv` to check whether `--frozen-lockfile` was passed.
This commit is contained in:
David Taylor 2022-07-13 16:54:45 +01:00 committed by GitHub
parent 806e0f2885
commit ae08c72a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@
"puppeteer-core": "^13.7.0"
},
"scripts": {
"postinstall": "yarn --cwd app/assets/javascripts/discourse"
"postinstall": "yarn --cwd app/assets/javascripts/discourse $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')"
},
"engines": {
"node": "16.* || >= 18",