Skip to content

Commit

Permalink
Don't "npm rm npm" on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic authored and isaacs committed Dec 5, 2012
1 parent 1a98de8 commit 223cada
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ function main (cb) {
installAllThenTestAll()

function installAllThenTestAll () {
var packagesToRm = packages
if (process.platform !== "win32") {
// Windows can't handle npm rm npm due to file-in-use issues.
packagesToRm.push("npm")
}

chain
( [ setup
, [ exec, "npm install "+npmpkg ]
Expand All @@ -153,7 +159,7 @@ function main (cb) {
, [ execChain, packages.map(function (p) {
return "npm test "+p
}) ]
, [ execChain, packages.concat("npm").map(function (p) {
, [ execChain, packagesToRm.map(function (p) {
return "npm rm " + p
}) ]
, installAndTestEach
Expand All @@ -163,16 +169,21 @@ function main (cb) {
}

function installAndTestEach (cb) {
chain
( [ setup
var thingsToChain = [
setup
, [ execChain, packages.map(function (p) {
return [ "npm install packages/"+p
, "npm test "+p
, "npm rm "+p ]
}) ]
, [exec, "npm rm npm"]
, publishTest
], cb )
]
if (process.platform !== "win32") {
// Windows can't handle npm rm npm due to file-in-use issues.
thingsToChain.push([exec, "npm rm npm"])
}
thingsToChain.push(publishTest)

chain(thingsToChain, cb)
}

function publishTest (cb) {
Expand Down

0 comments on commit 223cada

Please sign in to comment.