Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Try deleting .bin in exported packages before pruning to workaround i…
Browse files Browse the repository at this point in the history
…ssue on Travis
  • Loading branch information
elisee committed Mar 18, 2019
1 parent 7c49375 commit 7e10189
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const path = require("path");
const getBuildPaths = require("./getBuildPaths");
const readdirRecursive = require("recursive-readdir");
const mkdirp = require("mkdirp");
const rimraf = require("rimraf");
const async = require("async");
const _ = require("lodash");
const child_process = require("child_process");
Expand Down Expand Up @@ -76,6 +77,10 @@ readdirRecursive(sourceRootPath, [ shouldIgnore ], (err, files) => {

async.eachSeries(buildPaths, (buildPath, cb) => {
if (!fs.existsSync(`${buildPath}/package.json`)) { cb(); return; }

// On Travis, npm fails to prune if we don't do that
rimraf.sync(`${buildPath}/node_modules/.bin`);

const spawnOptions = { cwd: buildPath, env: process.env, stdio: "inherit" };
const npm = child_process.spawn(`npm${execSuffix ? ".cmd" : ""}`, [ "prune", "--production" ], spawnOptions);

Expand Down

0 comments on commit 7e10189

Please sign in to comment.