Skip to content

Commit f5d4cce

Browse files
committed
refactor: Moving _gitignore rename earlier
1 parent db4c412 commit f5d4cce

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ async function scaffold(to, opts) {
143143
};
144144
await fs.writeFile(pkgPath, JSON.stringify(pkg, null, '\t'));
145145
}
146-
147-
// Publishing to npm renames the .gitignore to .npmignore
148-
// https://github.com/npm/npm/issues/7252#issuecomment-253339460
149-
await fs.rename(resolve(to, '_gitignore'), resolve(to, '.gitignore'));
150146
}
151147

152148
/**
@@ -168,6 +164,9 @@ async function templateDir(from, to, useTS) {
168164
return templateDir(filename, resolve(to, f), useTS);
169165
}
170166
if (useTS && /\.jsx?$/.test(f)) f = f.replace('.js', '.ts');
167+
// Publishing to npm renames the .gitignore to .npmignore
168+
// https://github.com/npm/npm/issues/7252#issuecomment-253339460
169+
if (f === '_gitignore') f = '.gitignore';
171170
await fs.copyFile(filename, resolve(to, f));
172171
}),
173172
);

0 commit comments

Comments
 (0)