Skip to content

Commit 2083a33

Browse files
committed
fix: more slash
1 parent c825ac2 commit 2083a33

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/template.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,13 @@ export interface CopyConfig {
8787
export async function copy(args: CopyConfig) {
8888
const templateFiles = await globby(slash(args.templateDir), { dot: true });
8989
for (const sourcePath of templateFiles) {
90-
const relativePath = path.relative(args.templateDir, sourcePath);
91-
const targetPath = slash(format(
92-
path.resolve(args.packageDir, relativePath),
93-
args.view
94-
)).replace(/\/gitignore$/, '/.gitignore'); // https://github.com/uetchy/create-create-app/issues/38
90+
const relativePath = path.relative(args.templateDir, slash(sourcePath));
91+
const targetPath = slash(
92+
format(path.resolve(args.packageDir, relativePath), args.view)
93+
).replace(/\/gitignore$/, '/.gitignore'); // https://github.com/uetchy/create-create-app/issues/38
9594
prepareDirectory(targetPath);
9695

97-
let sourceData = fs.readFileSync(sourcePath);
96+
let sourceData = fs.readFileSync(slash(sourcePath));
9897
let targetData = sourceData;
9998
if (isUtf8(sourceData)) {
10099
targetData = Buffer.from(format(sourceData, args.view));

0 commit comments

Comments
 (0)