This repository has been archived by the owner on Jun 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from AllanYangZhou/develop
Last minute fixes + release script
- Loading branch information
Showing
6 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
var minimist = require('minimist'); | ||
var packager = require('electron-packager'); | ||
var execSync = require('child_process').execSync; | ||
|
||
function build() { | ||
console.log('Packaging with webpack, using the production config'); | ||
var child = execSync('npm run-script build', function(err, stdout, stderr) { | ||
console.log('stderr: ', stderr); | ||
if (err !== null) { | ||
console.log('error: ', err); | ||
} | ||
}); | ||
} | ||
|
||
function pack(prod, platform, arch) { | ||
var opts = {}; //packaging options | ||
|
||
if (prod) { | ||
console.log('Packaging for all platforms'); | ||
opts.all = true; // build for all platforms and arch | ||
} else { | ||
console.log('Packaging for: ', platform, arch); | ||
opts.platform = platform; | ||
opts.arch = arch; | ||
} | ||
|
||
opts.dir = __dirname; // source dir | ||
opts.name = 'dawn'; | ||
opts.prune = true; //remove dev dependencies | ||
opts.icon = './icons/icon'; | ||
opts.version = '0.36.2'; | ||
opts.out = '../..' | ||
|
||
packager(opts, function(err, appPath) { | ||
if (err) { | ||
console.log('Packaging error: ', err); | ||
} else { | ||
console.log(appPath); | ||
} | ||
}); | ||
} | ||
|
||
// General release command: 'node release.js --prod'. | ||
// If you already ran build: 'node release.js --prod --prebuilt' | ||
// For a specific target: 'node release.js --platform=... --arch=...' | ||
function main() { | ||
var argv = minimist(process.argv.slice(2)); | ||
|
||
if (!argv.prebuilt) { | ||
build(); | ||
} | ||
|
||
pack(argv.prod, argv.platform, argv.arch); | ||
} | ||
|
||
main(); |