From 0fd220e756060ca220455b1beb0f226242506356 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Oct 2016 16:18:38 +0100 Subject: [PATCH 1/2] Added 'scripts' as an optional paramter --- bin/electron-osx-flat-usage.txt | 1 + index.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bin/electron-osx-flat-usage.txt b/bin/electron-osx-flat-usage.txt index b16c889..ecf6efd 100644 --- a/bin/electron-osx-flat-usage.txt +++ b/bin/electron-osx-flat-usage.txt @@ -8,3 +8,4 @@ install Path to install for the bundle. Default `/Applications`. keychain The keychain name. Default to system default keychain. platform Build platform of Electron. Allowed values: darwin, mas. Default to auto detect from application package. pkg Path to the output package. +scripts Path to a directory containing pre and/or post install scripts. diff --git a/index.js b/index.js index db5c80c..acbe5fc 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,9 @@ function flatApplicationAsync (opts) { if (opts.keychain) { args.unshift('--keychain', opts.keychain) } + if (opts.scripts) { + args.unshift('--scripts', opts.scripts) + } debuglog('Flattening... ' + opts.app) return execFileAsync('productbuild', args) @@ -616,6 +619,7 @@ function flatAsync (opts) { debuglog('> package-output ' + opts.pkg) debuglog('> install-path ' + opts.install) debuglog('> identity ' + opts.identity) + debuglog('> scripts ', opts.scripts) return flatApplicationAsync(opts) }) .then(function () { From 15dbdc19e3f50217592ec801cacbbc7906788494 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Oct 2016 22:41:46 +0100 Subject: [PATCH 2/2] Fixed typo on scripts debuglog --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index acbe5fc..c133dce 100644 --- a/index.js +++ b/index.js @@ -619,7 +619,7 @@ function flatAsync (opts) { debuglog('> package-output ' + opts.pkg) debuglog('> install-path ' + opts.install) debuglog('> identity ' + opts.identity) - debuglog('> scripts ', opts.scripts) + debuglog('> scripts ' + opts.scripts) return flatApplicationAsync(opts) }) .then(function () {