File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22/* eslint-disable @typescript-eslint/no-unused-vars */
33
4- import { join as pathJoin , relative as pathRelative } from "path" ;
4+ import {
5+ join as pathJoin ,
6+ relative as pathRelative ,
7+ sep as pathSep ,
8+ posix as pathPosix
9+ } from "path" ;
510import * as fs from "fs" ;
611import { getProjectRoot } from "./tools/getProjectRoot" ;
712import { assert } from "tsafe/assert" ;
@@ -93,7 +98,13 @@ import type { Equals } from "tsafe";
9398
9499 const gitignoreRaw = fs . readFileSync ( gitignoreFilePath ) . toString ( "utf8" ) ;
95100
96- const pathToIgnore = `/${ pathJoin ( pathRelative ( projectDirPath , publicDirPath ) , "dsfr" ) } /` ;
101+ const pathToIgnore = `/${ pathJoin (
102+ pathRelative ( projectDirPath , publicDirPath ) . replace (
103+ new RegExp ( `\\${ pathSep } ` , "g" ) ,
104+ pathPosix . sep
105+ ) ,
106+ "dsfr"
107+ ) } /`;
97108
98109 if ( gitignoreRaw . split ( "\n" ) . find ( line => line . startsWith ( pathToIgnore ) ) !== undefined ) {
99110 break edit_gitignore;
You can’t perform that action at this time.
0 commit comments