Skip to content

Commit

Permalink
Allow version stamp skipping and local pkg install. (#876)
Browse files Browse the repository at this point in the history
* Add temporary target used to test with local fork of pkg.

* Honor ZAP_SKIP_REAL_VERSION environment variable.
  • Loading branch information
tecimovic authored Jan 4, 2023
1 parent cf7581e commit d785a5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"pack:cli:mac": "node ./src-script/pack-cli.js -p mac",
"pkg": "npx pkg --out-path dist/ --compress GZip --options max-old-space-size=4096 .",
"pkg:linux": "npx pkg -t node16-linux-x64 --output dist/zap-linux --compress GZip --options max-old-space-size=4096 .",
"pkg-use-local-fork": "node ../pkg/lib-es5/bin.js -t node16-linux-x64 --output dist/zap-linux --compress GZip --options max-old-space-size=4096 .",
"pkg:win": "npx pkg -t node16-win-x64 --output dist/zap-win.exe --compress GZip --options max-old-space-size=4096 .",
"pkg:mac": "npx pkg -t node16-macos-x64 --output dist/zap-macos --compress GZip --options max-old-space-size=4096 .",
"mattersdk": "node src-script/zap-start.js regenerateSdk --sdk ~/git/matter/scripts/tools/sdk.json",
Expand Down
6 changes: 6 additions & 0 deletions src-script/script-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ async function stampVersion() {
* @param {*} mode 'fake', 'real' or 'print'
*/
async function setPackageJsonVersion(date, mode) {
if (process.env.ZAP_SKIP_REAL_VERSION != null) {
// If you set ZAP_SKIP_REAL_VERSION environment variable, then this whole
// version muddling is turned off.
return true
}

let promise = new Promise((resolve, reject) => {
let packageJson = path.join(__dirname, '../package.json')
let output = ''
Expand Down

0 comments on commit d785a5b

Please sign in to comment.