Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bootstrap install to use quotes around versions #235

Merged
merged 2 commits into from Jun 20, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/BootstrapCommand.js
Expand Up @@ -109,7 +109,7 @@ export default class BootstrapCommand extends Command {
return !this.hasDependencyInstalled(pkg, dependency);
})
.map(dependency => {
return dependency + "@" + allDependencies[dependency];
return dependency + "@\"" + allDependencies[dependency] + "\"";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting into the range where a template string might be more readable:

return `${dependency}@"${allDependencies[dependency]}"`;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gigabo i concur

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could leave a comment of an example package version of why it needs the quotes

});

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