Skip to content

Commit

Permalink
fix(local-cli): if _gitignore exists, rename it to .gitignore
Browse files Browse the repository at this point in the history
Because npm never publishes a `.gitignore` file, we need to rename
our `.gitignore` files in our templates to `_gitignore` and have the
`hops-local-cli` `init()` method rename it again, after unpacking.

Read more about it: npm/npm#1862

Related to: #275
  • Loading branch information
ZauberNerd committed Nov 22, 2017
1 parent 1441d20 commit 37f72ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/local-cli/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ function init (root, appName, options) {
strip: 1
}).then(function () {
fs.unlinkSync(tarball);
if (fs.existsSync(path.resolve(appRoot, '_gitignore'))) {
fs.renameSync(
path.resolve(appRoot, '_gitignore'),
path.resolve(appRoot, '.gitignore')
);
}
var newPackageManifest = readPackageManifest(pathToPackageManifest);
writePackageManifest(
pathToPackageManifest,
Expand Down

0 comments on commit 37f72ee

Please sign in to comment.