Skip to content

Commit 47eec0f

Browse files
committed
#47: Fix, for real this time
1 parent 31eb14b commit 47eec0f

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/bin/copy-dsfr-to-public.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
#!/usr/bin/env node
22
/* eslint-disable @typescript-eslint/no-unused-vars */
33

4-
import {
5-
join as pathJoin,
6-
relative as pathRelative,
7-
sep as pathSep,
8-
posix as pathPosix
9-
} from "path";
4+
import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
105
import * as fs from "fs";
116
import { getProjectRoot } from "./tools/getProjectRoot";
127
import { assert } from "tsafe/assert";
@@ -99,12 +94,9 @@ import type { Equals } from "tsafe";
9994
const gitignoreRaw = fs.readFileSync(gitignoreFilePath).toString("utf8");
10095

10196
const pathToIgnore = `/${pathJoin(
102-
pathRelative(projectDirPath, publicDirPath).replace(
103-
new RegExp(`\\${pathSep}`, "g"),
104-
pathPosix.sep
105-
),
97+
pathRelative(projectDirPath, publicDirPath),
10698
"dsfr"
107-
)}/`;
99+
).replace(new RegExp(`\\${pathSep}`, "g"), "/")}/`;
108100

109101
if (gitignoreRaw.split("\n").find(line => line.startsWith(pathToIgnore)) !== undefined) {
110102
break edit_gitignore;

0 commit comments

Comments
 (0)