Skip to content

Commit

Permalink
Merge pull request #9 from eslint/issue8
Browse files Browse the repository at this point in the history
Fix: Ensure bundled dependencies are correct (fixes #8)
  • Loading branch information
nzakas committed Mar 25, 2016
2 parents 662c0c9 + 8af49ea commit 4d947af
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions lib/release-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,15 @@ function release(prereleaseId) {

validateSetup();

console.log("Updating dependencies");
ShellOps.execSilent("npm update && npm prune");
console.log("Updating dependencies (this may take a while)");
shelljs.rm("-rf", "node_modules");
ShellOps.execSilent("npm install");

// necessary so later "npm install" will install the same versions
console.log("Shrinkwrapping dependencies");
ShellOps.execSilent("npm shrinkwrap");

// TODO: Make this work
// console.log("Checking licenses");
// checkLicenses();

Expand All @@ -349,7 +355,7 @@ function release(prereleaseId) {
ShellOps.exec("bundle-dependencies update");

console.log("Committing to git");
ShellOps.exec("git add .");
ShellOps.exec("git add CHANGELOG.md package.json");
ShellOps.exec("git commit -m \"Build: package.json and changelog update for " + releaseInfo.version + "\"");

console.log("Generating %s", releaseInfo.version);
Expand All @@ -359,6 +365,10 @@ function release(prereleaseId) {
console.log("Publishing to git");
ShellOps.exec("git push origin master --tags");

console.log("Fixing dependencies for bundle");
shelljs.rm("-rf", "node_modules");
ShellOps.execSilent("npm install --production");

console.log("Publishing to npm");
getPackageInfo().files.filter(function(dirPath) {
return fs.lstatSync(dirPath).isDirectory();
Expand All @@ -376,6 +386,12 @@ function release(prereleaseId) {
// undo any line fix differences
ShellOps.exec("git reset");

// restore development environment
ShellOps.exec("npm install");

// delete shrinkwrap file
shelljs.rm("npm-shrinkwrap.json");

return releaseInfo;
}

Expand Down

0 comments on commit 4d947af

Please sign in to comment.