File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,18 @@ const { chdir } = process;
66
77// Dynamically get current the name of this file you are in, and its parent folder
88const developerJsFileName = basename ( __filename /*, extname(__filename)*/ ) ;
9- const cleanupFolderPath = dirname ( new URL ( import . meta. url ) . pathname ) ;
109
10+ const currentFileUrl = import . meta. url ;
11+
12+ let newUrl ;
13+ if ( process . platform === "darwin" || process . platform === "linux" ) {
14+ newUrl = new URL ( currentFileUrl ) . pathname ;
15+ } else
16+ newUrl = new URL ( currentFileUrl ) . pathname . substring (
17+ new URL ( currentFileUrl ) . pathname . indexOf ( "/" ) + 1
18+ ) ;
19+
20+ const cleanupFolderPath = dirname ( newUrl ) ;
1121// Change directory into the dynamically gotten parent folder, then extract folder name from path
1222chdir ( cleanupFolderPath ) ;
1323const cleanupFolderName = basename ( resolve ( ) ) ;
You can’t perform that action at this time.
0 commit comments