Fix invalid lib path on windows

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

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

Loading…
Cancel
Save