Skip to content

Commit b179583

Browse files
fix: incorrect path detection on Node.js
Signed-off-by: GitHub <[email protected]>
1 parent 2ec21ef commit b179583

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/typescript/utils/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ export function systemPrefix(pathLike: string, createDirIfNotExists = false) {
8585
const directoryOrFile = path.resolve(
8686
process.env.SUDO_PREFIX ?? __dirname,
8787
process.env.SUDO_PREFIX ? "" : "../../../..",
88-
__filename.endsWith(".ts") ? "" : "..",
8988
pathLike
9089
);
9190

92-
if (createDirIfNotExists) mkdirSync(directoryOrFile, { recursive: true });
91+
if (createDirIfNotExists) {
92+
mkdirSync(directoryOrFile, { recursive: true });
93+
}
9394

9495
return directoryOrFile;
9596
}

0 commit comments

Comments
 (0)