From 92a8d09e498712aec2ba0e54a1ad85194ebd83af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 24 May 2024 00:43:38 +0100 Subject: 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 --- cli/util/path.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/util') 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 { + 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 { -- cgit v1.2.3