We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
gitignore
1 parent 6623b9b commit bffca9cCopy full SHA for bffca9c
1 file changed
src/template.ts
@@ -2,7 +2,7 @@ import fs from 'fs';
2
import globby from 'globby';
3
import Handlebars from 'handlebars';
4
import isUtf8 from 'is-utf8';
5
-import path from 'path';
+import path, { sep } from 'path';
6
import slash from 'slash';
7
import { v4 as uuidv4 } from 'uuid';
8
import { View } from '.';
@@ -91,7 +91,7 @@ export async function copy(args: CopyConfig) {
91
const targetPath = format(
92
slash(path.resolve(args.packageDir, relativePath)),
93
args.view
94
- ).replace(/gitignore$/, '.gitignore'); // https://github.com/uetchy/create-create-app/issues/38
+ ).replace(new RegExp(`${sep}gitignore$`, 'g'), `${sep}.gitignore`); // https://github.com/uetchy/create-create-app/issues/38
95
prepareDirectory(targetPath);
96
97
let sourceData = fs.readFileSync(sourcePath);
0 commit comments