From 643a58997489846b1d238ee8492078e78ae48a87 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 10 Aug 2017 23:31:37 -0700 Subject: [PATCH] Fix .travis.yml formatting, was not installing apt packages --- .travis.yml | 32 ++++++++++++++++---------------- scripts/postinstall.js | 5 +++-- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbf38156a..c94acd609 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,22 +6,22 @@ node_js: - '6.9' addons: - artifacts: true - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - build-essential - - clang - - fakeroot - - g++-4.8 - - git - - libgnome-keyring-dev - - xvfb - - rpm - - libxext-dev - - libxtst-dev - - libxkbfile-dev +- artifacts: true +- apt: + sources: + - ubuntu-toolchain-r-test + packages: + - build-essential + - clang + - fakeroot + - g++-4.8 + - git + - libgnome-keyring-dev + - xvfb + - rpm + - libxext-dev + - libxtst-dev + - libxkbfile-dev branches: only: diff --git a/scripts/postinstall.js b/scripts/postinstall.js index d01d29948..4d7c46f60 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -37,12 +37,13 @@ function npm(cmd, options) { // For speed, we cache app/node_modules. However, we need to // be sure to do a full rebuild of native node modules when the // Electron version changes. To do this we check a marker file. -const cacheVersionPath = './app/node_modules/.postinstall-target-version'; +const appModulesPath = path.resolve(__dirname, '..', 'app', 'node_modules'); +const cacheVersionPath = path.join(appModulesPath, '.postinstall-target-version'); const cacheElectronTarget = fs.existsSync(cacheVersionPath) && fs.readFileSync(cacheVersionPath).toString(); if (cacheElectronTarget !== npmElectronTarget) { console.log(`\n-- Clearing app/node_modules --`) - rimraf.sync(path.resolve(__dirname, '..', 'app', 'node_modules')); + rimraf.sync(appModulesPath); } // run `npm install` in ./app with Electron NPM config