Commit ca5e8f27 authored by Stanley Shyiko's avatar Stanley Shyiko

Integrated electron-packager for Mac OS X & Linux standalone packaged

parent 91c4a512
#!/usr/bin/env node
process.env.ELECTRON_HAR_AS_NPM_MODULE = 1;
require('child_process').
spawn(
require('electron-prebuilt'),
......
......@@ -14,8 +14,19 @@
"json-stable-stringify": "^1.0.0",
"electron-prebuilt": "^0.35.4"
},
"devDependencies": {
"electron-packager": "^5.1.1"
},
"scripts": {
"start-dev": "electron src --debug"
"clean": "rm -rf build",
"build:app": "mkdir -p build && cp -r src build/app && cp package.json build/app && cd build/app && npm i --production && npm un electron-prebuilt",
"build:macosx": "electron-packager build/app electron-har --platform=darwin --arch=x64 --version=0.35.4 --out=build --overwrite --app-bundle-id=com.github.shyiko.ElectronHAR --app-category-type=public.app-category.developer-tools --app-version=$npm_package_version && mv build/electron-har-darwin-x64/electron-har.app/Contents/MacOS/{Electron,electron-har} && sed -i 's/>Electron</>electron-har</g' build/electron-har-darwin-x64/electron-har.app/Contents/Info.plist",
"build:linux": "electron-packager build/app electron-har --platform=linux --arch=x64 --version=0.35.4 --out=build --overwrite",
"build": "npm run clean && npm run build:app && npm run build:macosx && npm run build:linux",
"tar:macosx": "(cd build/electron-har-darwin-x64 && tar -cvzf ../electron-har-$npm_package_version-darwin-x64.tar.gz *)",
"tar:linux": "(cd build/electron-har-linux-x64 && tar -cvzf ../electron-har-$npm_package_version-linux-x64.tar.gz *)",
"tar": "npm run tar:macosx && npm run tar:linux",
"release": "npm run build && npm run tar"
},
"keywords": [
"electron",
......
......@@ -8,7 +8,8 @@ var yargs = require('yargs')
.help('h').alias('h', 'help')
.version(function () { return require('../package').version; })
.strict();
var argv = yargs.argv;
var argv = process.env.ELECTRON_HAR_AS_NPM_MODULE ?
yargs.argv : yargs.parse(process.argv.slice(1));
var url = argv._[0];
if (argv.u) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment