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

Commit 7e10189

Browse files
committed
Try deleting .bin in exported packages before pruning to workaround issue on Travis
1 parent 7c49375 commit 7e10189

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/package.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const path = require("path");
66
const getBuildPaths = require("./getBuildPaths");
77
const readdirRecursive = require("recursive-readdir");
88
const mkdirp = require("mkdirp");
9+
const rimraf = require("rimraf");
910
const async = require("async");
1011
const _ = require("lodash");
1112
const child_process = require("child_process");
@@ -76,6 +77,10 @@ readdirRecursive(sourceRootPath, [ shouldIgnore ], (err, files) => {
7677

7778
async.eachSeries(buildPaths, (buildPath, cb) => {
7879
if (!fs.existsSync(`${buildPath}/package.json`)) { cb(); return; }
80+
81+
// On Travis, npm fails to prune if we don't do that
82+
rimraf.sync(`${buildPath}/node_modules/.bin`);
83+
7984
const spawnOptions = { cwd: buildPath, env: process.env, stdio: "inherit" };
8085
const npm = child_process.spawn(`npm${execSuffix ? ".cmd" : ""}`, [ "prune", "--production" ], spawnOptions);
8186

0 commit comments

Comments
 (0)