Fix invalid lib path on windows

Fixes #2
main
trivernis 1 year ago
parent 9cb63a1a6c
commit cefc25097f
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -10,21 +10,27 @@ impl NodePath {
Self { base } Self { base }
} }
#[cfg(not(target_os = "windows"))] #[cfg(not(windows))]
pub fn bin(&self) -> PathBuf { pub fn bin(&self) -> PathBuf {
self.base.join("bin").canonicalize().unwrap() self.base.join("bin")
} }
pub fn lib(&self) -> PathBuf { #[cfg(windows)]
self.base.join("lib").canonicalize().unwrap() pub fn bin(&self) -> PathBuf {
self.base.to_owned()
} }
pub fn node_modules(&self) -> PathBuf { #[cfg(not(windows))]
self.lib().join("node_modules") pub fn lib(&self) -> PathBuf {
self.base.join("lib")
} }
#[cfg(target_os = "windows")] #[cfg(windows)]
pub fn bin(&self) -> PathBuf { pub fn lib(&self) -> PathBuf {
self.base.to_owned() self.base.to_owned()
} }
pub fn node_modules(&self) -> PathBuf {
self.lib().join("node_modules")
}
} }

Loading…
Cancel
Save