diff --git a/electron/package.json b/electron/package.json index 54e34f2476..b8ab96dd41 100644 --- a/electron/package.json +++ b/electron/package.json @@ -80,8 +80,12 @@ "lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"", "test:e2e": "DEBUG=pw:browser xvfb-maybe -- playwright test --workers=1", "copy:assets": "rimraf --glob \"./pre-install/*.tgz\" && cpx \"../pre-install/*.tgz\" \"./pre-install\"", - "version-patch": "jq '.version' package.json | tr -d '\"' > .version.bak && jq --arg ver \"0.1.$(date +%s)\" '.version = $ver' package.json > package.tmp && mv package.tmp package.json", - "version-restore": "jq --arg ver $(cat .version.bak) '.version = $ver' package.json > package.tmp && mv package.tmp package.json && rm .version.bak", + "version-patch": "run-script-os", + "version-patch:darwin:linux": "jq '.version' package.json | tr -d '\"' > .version.bak && jq --arg ver \"0.1.$(date +%s)\" '.version = $ver' package.json > package.tmp && mv package.tmp package.json", + "version-patch:win32": "node -e \"const fs=require('fs');const pkg=require('./package.json');const bak=pkg.version;fs.writeFileSync('.version.bak',bak);pkg.version='0.1.'+Math.floor(Date.now()/1000);fs.writeFileSync('package.json',JSON.stringify(pkg,null,2));\"", + "version-restore": "run-script-os", + "version-restore:darwin:linux": "jq --arg ver $(cat .version.bak) '.version = $ver' package.json > package.tmp && mv package.tmp package.json && rm .version.bak", + "version-restore:win32": "node -e \"const fs=require('fs');const pkg=require('./package.json');const bak=fs.readFileSync('.version.bak','utf8');pkg.version=bak;fs.writeFileSync('package.json',JSON.stringify(pkg,null,2));\"", "dev:darwin:linux": "yarn copy:assets && tsc -p . && yarn version-patch && electron . && yarn version-restore", "dev:windows": "yarn copy:assets && tsc -p . && electron .", "dev": "run-script-os", @@ -141,4 +145,4 @@ "hoistingLimits": "workspaces" }, "packageManager": "yarn@4.5.3" -} +} \ No newline at end of file