From 25db4eec9d5f092bab3a28bc434bf28636382762 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 28 Mar 2016 13:55:18 -0700 Subject: [PATCH] Update package.js for electron-packager v6 --- bin/package.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/package.js b/bin/package.js index 95e1ccfa..3a50d8cb 100755 --- a/bin/package.js +++ b/bin/package.js @@ -37,8 +37,8 @@ var all = { // Build 64 bit binaries only. arch: 'x64', - // The application source directory. - dir: config.ROOT_PATH, + // The human-readable copyright line for the app. + 'app-copyright': config.APP_COPYRIGHT, // The release version of the application. Maps to the `ProductVersion` metadata // property on Windows, and `CFBundleShortVersionString` on OS X. @@ -58,6 +58,9 @@ var all = { // Windows requires the build version to start with a number :/ so we stick on a prefix 'build-version': '0-' + cp.execSync('git rev-parse --short HEAD').toString().replace('\n', ''), + // The application source directory. + dir: config.ROOT_PATH, + // Pattern which specifies which files to ignore when copying files to create the // package(s). ignore: /^\/dist|\/(appveyor.yml|.appveyor.yml|appdmg|AUTHORS|CONTRIBUTORS|bench|benchmark|benchmark\.js|bin|bower\.json|component\.json|coverage|doc|docs|docs\.mli|dragdrop\.min\.js|example|examples|example\.html|example\.js|externs|ipaddr\.min\.js|Makefile|min|minimist|perf|rusha|simplepeer\.min\.js|simplewebsocket\.min\.js|static\/screenshot\.png|test|tests|test\.js|tests\.js|webtorrent\.min\.js|\.[^\/]*|.*\.md|.*\.markdown)$/, @@ -105,9 +108,6 @@ var win32 = { // Company that produced the file. CompanyName: config.APP_NAME, - // Copyright notices that apply to the file. - LegalCopyright: config.APP_COPYRIGHT, - // Name of the program, displayed to users FileDescription: config.APP_NAME, @@ -149,6 +149,8 @@ function buildDarwin (cb) { var infoPlistPath = path.join(contentsPath, 'Info.plist') var infoPlist = plist.parse(fs.readFileSync(infoPlistPath, 'utf8')) + // TODO: Use new `extend-info` and `extra-resource` opts to electron-packager, + // available as of v6. infoPlist.CFBundleDocumentTypes = [ { CFBundleTypeExtensions: [ 'torrent' ], @@ -176,8 +178,6 @@ function buildDarwin (cb) { } ] - infoPlist.NSHumanReadableCopyright = config.APP_COPYRIGHT - fs.writeFileSync(infoPlistPath, plist.build(infoPlist)) // Copy torrent file icon into app bundle @@ -206,6 +206,8 @@ function buildDarwin (cb) { verbose: true } + // TODO: Use the built-in `sign` opt to electron-packager that takes an options + // object as of v6. sign(signOpts, function (err) { if (err) return cb(err)