Skip to content

Commit

Permalink
Update the packaging scripts to support extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sedwards2009 committed Aug 19, 2017
1 parent 7d22571 commit ae81aea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

"electron-rebuild": "node ./node_modules/electron-rebuild/lib/src/cli.js -o ptyw.js,font-manager -f -v 1.6.8",

"npm-prune-extensions": "node src/build_scripts/npm_extensions.js prune",

"testbulkdomoperation": "npm run build && nodeunit src/BulkDomOperationTest.js",
"testextensionloader": "npm run build && nodeunit src/ExtensionLoaderTest.js",
"testkeybindingmanager": "npm run build && nodeunit src/KeyBindingManagerTest.js",
Expand Down
11 changes: 8 additions & 3 deletions src/build_scripts/build_packages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 Simon Edwards <[email protected]>
* Copyright 2014-2017 Simon Edwards <[email protected]>
*
* This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
*/
Expand Down Expand Up @@ -33,7 +33,9 @@ function main() {

echo("Fetching a clean copy of the source code from " + gitUrl);
cd(BUILD_TMP);
const buildTmpPath = pwd();

// For some reason pwd() is returning "not quite strings" which path.join() doesn't like. Thus "" + ...
const buildTmpPath = "" + pwd();

exec("git clone --depth 1 " + gitUrl);

Expand All @@ -42,12 +44,15 @@ function main() {
cd("extraterm");
echo("Downloading dependencies.");
exec("npm install");
exec("npm run npm-install-extensions");

echo("Building");
exec("npm run build");

exec("npm run build-extensions");

echo("Removing development dependencies");
exec("npm prune --production");
exec("npm run npm-prune-extensions");

// Create the commands zip
echo("Creating commands.zip");
Expand Down
4 changes: 4 additions & 0 deletions src/build_scripts/npm_extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ switch(process.argv[2]) {
npmCommandExtensions('install');
break;

case 'prune':
npmCommandExtensions('prune --production');
break;

default:
echo("Bad argument to npm_extensions.js");
process.exit(1);
Expand Down

0 comments on commit ae81aea

Please sign in to comment.