Skip to content

Commit

Permalink
fix: incorrect path detection on Node.js
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
virtual-designer authored Dec 20, 2024
1 parent 2ec21ef commit b179583
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/typescript/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ export function systemPrefix(pathLike: string, createDirIfNotExists = false) {
const directoryOrFile = path.resolve(
process.env.SUDO_PREFIX ?? __dirname,
process.env.SUDO_PREFIX ? "" : "../../../..",
__filename.endsWith(".ts") ? "" : "..",
pathLike
);

if (createDirIfNotExists) mkdirSync(directoryOrFile, { recursive: true });
if (createDirIfNotExists) {
mkdirSync(directoryOrFile, { recursive: true });
}

return directoryOrFile;
}
Expand Down

0 comments on commit b179583

Please sign in to comment.