Skip to content

Commit

Permalink
Relative path only on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Oct 10, 2023
1 parent c294dc4 commit 400a6a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lombiq.NodeJs.Extensions/scripts/get-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function getRelativePath() {
process.stderr.write(`GET_RELATIVE_PATH: effectivePath: "${effectivePath}"\n`);
process.stderr.write(`GET_RELATIVE_PATH: effectivePath (relative to ${process.cwd()}): "${path.relative(process.cwd(), effectivePath)}"\n`);

// Return a relative path because it'll be much shorter than the absolute one; to avoid too long commands.
return location === 'source' ? effectivePath : path.relative(process.cwd(), effectivePath);
// On Windows return a relative path because it'll be much shorter than the absolute one; to avoid too long commands.
return process.platform === "win32" ? path.relative(process.cwd(), effectivePath) : effectivePath;
}

// Writing the existing path to stdout lets us consume it at the call site. If the path doesn't exist we return an error
Expand Down

0 comments on commit 400a6a3

Please sign in to comment.