Merge pull request #2778 from MartinFournier/feat/electron-build-script

Modify electron build script to allow platform selection
This commit is contained in:
hydroflame 2022-01-26 00:40:49 -05:00 committed by GitHub
commit 2c9302ee53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

@ -16,6 +16,8 @@
"./dist/**/*",
"./node_modules/**/*",
"./public/**/*",
"./src/**",
"./lib/**,",
"*.js"
],
"directories": {

@ -119,6 +119,10 @@
"watch:dev": "webpack --watch --mode development",
"electron": "sh ./package.sh",
"electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune",
"electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",
"electron:packager-mac": "electron-packager .package bitburner --platform darwin --arch x64 --out .build --overwrite --icon .package/icon.png",
"electron:packager-linux": "electron-packager .package bitburner --platform linux --arch x64 --out .build --overwrite --icon .package/icon.png",
"allbuild": "npm run build && npm run electron && git add --all && git commit --amend --no-edit && git push -f -u origin dev"
}
}

@ -1,5 +1,8 @@
#!/bin/sh
# Clear out any files remaining from old builds
rm -rf .package
mkdir -p .package/dist/src/ThirdParty || true
mkdir -p .package/src/ThirdParty || true
mkdir -p .package/node_modules || true
@ -26,5 +29,6 @@ cd electron
npm install
cd ..
BUILD_PLATFORM="${1:-"all"}"
# And finally build the app.
npm run electron:packager
npm run electron:packager-$BUILD_PLATFORM