From d0f42f4166ae180bab5f01455fa166cc2abf0428 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Mon, 1 Jan 2018 22:23:15 -0500 Subject: [PATCH] Build extension on init Also can be run via `yarn sync --build_extension` --- lib/util.js | 9 ++++++++- scripts/sync.js | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index c25942ccc269b..cb469a4768874 100644 --- a/lib/util.js +++ b/lib/util.js @@ -129,7 +129,14 @@ const util = { args += arg + '=' + val + ' ' } return args.replace(/"/g,'\\"') - } + }, + + buildExtension: () => { + const extensionDir = path.join(config.projects.antimuon.dir, 'vendor', 'brave-extension') + const options = { cwd: extensionDir } + util.run('yarn', ['install'], options) + util.run('yarn', ['run', 'build'], options) + }, } module.exports = util diff --git a/scripts/sync.js b/scripts/sync.js index 3cf804ff2b34c..9147147f90e42 100644 --- a/scripts/sync.js +++ b/scripts/sync.js @@ -14,6 +14,7 @@ program .option('--submodule_sync', 'run submodule sync') .option('--init', 'initialize all dependencies') .option('--all', 'update all projects') + .option('--build_extension', 'update all projects') projectNames.forEach((project) => { program.option('--' + project + '_ref ', project + ' ref to checkout') }) @@ -53,3 +54,7 @@ if (updatedVersion || program.init || program.run_sync) { if (updatedVersion || program.init || program.run_hooks) { util.gclientRunhooks() } + +if (program.init || program.all || program.build_extension) { + util.buildExtension() +}