Skip to content

Commit

Permalink
Fix bootstrap install to use quotes around versions (#235)
Browse files Browse the repository at this point in the history
* Fix bootstrap install to use quotes around versions

* Address PR feedback
  • Loading branch information
jamiebuilds committed Jun 20, 2016
1 parent 02ffb96 commit c0f1e8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/commands/BootstrapCommand.js
Expand Up @@ -109,7 +109,8 @@ export default class BootstrapCommand extends Command {
return !this.hasDependencyInstalled(pkg, dependency);
})
.map(dependency => {
return dependency + "@" + allDependencies[dependency];
// Needs "quotes" for versions like "^1.0.0 || ^2.0.0"
return `${dependency}@"${allDependencies[dependency]}"`;
});

if (externalPackages.length) {
Expand Down
6 changes: 3 additions & 3 deletions test/BootstrapCommand.js
Expand Up @@ -28,7 +28,7 @@ describe("BootstrapCommand", () => {

assertStubbedCalls([
[ChildProcessUtilities, "spawn", { nodeCallback: true }, [
{ args: ["npm", ["install", "package-1@^0.0.0"], { cwd: path.join(testDir, "packages/package-4"), stdio: "ignore" }] }
{ args: ["npm", ["install", "package-1@\"^0.0.0\""], { cwd: path.join(testDir, "packages/package-4"), stdio: "ignore" }] }
]]
]);

Expand Down Expand Up @@ -77,7 +77,7 @@ describe("BootstrapCommand", () => {

assertStubbedCalls([
[ChildProcessUtilities, "spawn", { nodeCallback: true }, [
{ args: ["npm", ["install", "package-1@^0.0.0"], { cwd: path.join(testDir, "packages/package-4"), stdio: "ignore" }] }
{ args: ["npm", ["install", "package-1@\"^0.0.0\""], { cwd: path.join(testDir, "packages/package-4"), stdio: "ignore" }] }
]]
]);

Expand Down Expand Up @@ -131,7 +131,7 @@ describe("BootstrapCommand", () => {

let installed = false;
stub(ChildProcessUtilities, "spawn", (command, args, options, callback) => {
assert.deepEqual(args, ["install", "external@^1.0.0"])
assert.deepEqual(args, ["install", "external@\"^1.0.0\""])
assert.deepEqual(options, { cwd: path.join(testDir, "packages/package-1"), stdio: "ignore" })
installed = true;
callback();
Expand Down

0 comments on commit c0f1e8d

Please sign in to comment.