summaryrefslogtreecommitdiff
path: root/cli/util
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-05-24 00:43:38 +0100
committerGitHub <noreply@github.com>2024-05-23 23:43:38 +0000
commit92a8d09e498712aec2ba0e54a1ad85194ebd83af (patch)
treed26e89bb46850665b2ed357a11718d8148850880 /cli/util
parent959739f609dddacde3bbe9ecede2f409214fb34c (diff)
fix(npm): set up node_modules/.bin/ entries for package that provide bin entrypoints (#23496)
Closes https://github.com/denoland/deno/issues/23036 --------- Co-authored-by: Nathan Whitaker <nathan@deno.com>
Diffstat (limited to 'cli/util')
-rw-r--r--cli/util/path.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/util/path.rs b/cli/util/path.rs
index 3c848edea..16378e30b 100644
--- a/cli/util/path.rs
+++ b/cli/util/path.rs
@@ -173,6 +173,11 @@ pub fn path_with_stem_suffix(path: &Path, suffix: &str) -> PathBuf {
}
}
+#[cfg_attr(windows, allow(dead_code))]
+pub fn relative_path(from: &Path, to: &Path) -> Option<PathBuf> {
+ pathdiff::diff_paths(to, from)
+}
+
/// Gets if the provided character is not supported on all
/// kinds of file systems.
pub fn is_banned_path_char(c: char) -> bool {