Skip to content

Commit e2a7103

Browse files
authored
Merge pull request #11 from vltansky/gitignore-fix
fix: .npmignore should be .gitignore
2 parents a1f4e51 + c8edcdb commit e2a7103

File tree

4 files changed

+6092
-6001
lines changed

4 files changed

+6092
-6001
lines changed

cli.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const path = require("path");
55
const chalk = require("chalk");
66
const ora = require("ora");
77
const { extract } = require("pacote");
8+
const glob = require("fast-glob");
89
const fs = require("fs-extra");
910
const os = require("os");
1011
const packageName = "html5-boilerplate";
@@ -43,6 +44,13 @@ module.exports = async () => {
4344
}
4445
await fs.copy(tempDir + "/dist", targetDir);
4546
await fs.remove(tempDir);
47+
// see https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
48+
const npmIgnoreFiles = await glob(
49+
`${targetDir.replace(/\\/g, "/")}/**/.npmignore`
50+
);
51+
for (const npmIgnore of npmIgnoreFiles) {
52+
await fs.rename(npmIgnore, npmIgnore.replace(/\.npmignore$/, ".gitignore"));
53+
}
4654
spinner.succeed();
4755
return;
4856
};

0 commit comments

Comments
 (0)