Skip to content

Commit

Permalink
Merge pull request #52 from insin/patch-1
Browse files Browse the repository at this point in the history
Fix failure to initialise package.json in Windows
  • Loading branch information
ericclemmons committed Jun 7, 2016
2 parents 7649f30 + bdcc648 commit e6fcd8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"changelog:generate": "github_changelog_generator --future-release $npm_package_version",
"coverage": "npm test && nyc report --reporter=text-lcov | coveralls",
"postversion": "npm run version:amend && git push origin master --tags && npm publish",
"test": "NODE_ENV=test nyc mocha",
"test": "cross-env NODE_ENV=test nyc mocha",
"version": "npm run changelog",
"version:amend": "git commit --amend -m \"Release v${npm_package_version}\""
},
Expand All @@ -42,6 +42,7 @@
},
"devDependencies": {
"coveralls": "^2.11.8",
"cross-env": "^1.0.8",
"expect": "^1.14.0",
"mocha": "^2.4.5",
"nyc": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module.exports.checkPackage = function checkPackage() {
}

console.info("Initializing `%s`...", "package.json");
spawn.sync("npm", ["init -y"], { stdio: "inherit" });
spawn.sync("npm", ["init", "-y"], { stdio: "inherit" });
};

module.exports.defaultOptions = defaultOptions;
Expand Down
4 changes: 2 additions & 2 deletions test/installer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("installer", function() {
expect(installer.check("something-linked")).toBe(undefined);
expect(this.lstatSync.calls.length).toBe(1);
expect(this.lstatSync.calls[0].arguments).toEqual([
[process.cwd(), "node_modules", "something-linked"].join("/"),
path.join(process.cwd(), "node_modules", "something-linked"),
]);
});
});
Expand Down Expand Up @@ -236,7 +236,7 @@ describe("installer", function() {
expect(this.sync.calls.length).toEqual(1);
expect(this.sync.calls[0].arguments).toEqual([
"npm",
["init -y"],
["init", "-y"],
{ stdio: "inherit" },
]);
});
Expand Down

0 comments on commit e6fcd8c

Please sign in to comment.