Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ityuany committed Jan 17, 2025
1 parent 365c728 commit 8a64883
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions crates/snm_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,24 @@ impl<'a> SNode<'a> {

let node_dir = self.config.node_bin_dir.join(&version);

let node_bin_dir = node_dir.join("bin");

let node_bin_file = node_bin_dir.join("node");

if node_bin_file.try_exists()? {
return Ok(node_bin_dir);
}
#[cfg(target_os = "windows")]
let node_bin_dir = {
let node_bin_file = node_dir.join("node.exe");
if node_bin_file.try_exists()? {
return Ok(node_dir);
}
node_dir
};

#[cfg(not(target_os = "windows"))]
let node_bin_dir = {
let node_bin_dir = node_dir.join("bin");
let node_bin_file = node_bin_dir.join("node");
if node_bin_file.try_exists()? {
return Ok(node_bin_dir);
}
node_bin_dir
};

NodeDownloader::new(self.config).download(version).await?;

Expand Down

0 comments on commit 8a64883

Please sign in to comment.