Skip to content

Commit

Permalink
Merge branch 'addon_build' into addon-images
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Oct 26, 2019
2 parents 9540037 + 5b3a093 commit 2a6d4f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 10 additions & 3 deletions bin/install-addons.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*
* Script to initialize addon packages under "addons/" with outer deps.
*/

const path = require('path');
const cp = require('child_process');
const fs = require('fs');
Expand All @@ -22,12 +29,12 @@ if (fs.existsSync(addonsPath)) {
const addonPath = path.join(addonsPath, folder);

// install only if there are dependencies listed
// also skip addon if it does not contain any package.json
// (might happen after branch switches)
let packageJson;
try {
packageJson = require(path.join(addonPath, 'package.json'));
} catch (e) {}
} catch (e) {
// swallow as changing branches can leave folders around
}
if (packageJson
&& (
(packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"postinstall": "node -e \"try { require('./bin/install-addons'); } catch(e) {}\"",
"prepackage": "npm run build",
"package": "webpack",
"start": "node demo/start",
Expand All @@ -18,7 +17,9 @@
"test-api": "mocha \"**/*.api.js\"",
"test-unit": "node ./bin/test.js",
"build": "tsc -b ./tsconfig.all.json",
"prepare": "npm run build",
"prepare": "npm run setup",
"setup": "npm run build",
"presetup": "node ./bin/install-addons.js",
"prepublishOnly": "npm run package",
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
"benchmark": "NODE_PATH=./out xterm-benchmark -r 5 -c test/benchmark/benchmark.json",
Expand Down

0 comments on commit 2a6d4f0

Please sign in to comment.