Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Mar 28, 2023
1 parent b50b7f3 commit 1a7899d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions rustwrap/src/providers/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ const INFO_JSON: &str = "info.json";

pub fn latest(opts: &NpmOpts) -> Result<semver::Version> {
#[cfg(not(target_os = "windows"))]
let npm = "npm";
let out = duct::cmd!("npm", "view", opts.root_package_name(), "version").read()?;
#[cfg(target_os = "windows")]
let npm = "npm.exe";

let out = duct::cmd!(npm, "view", opts.root_package_name(), "version").read()?;
let out = duct::cmd!(
"cmd",
"/C",
"npm",
"view",
opts.root_package_name(),
"version"
)
.read()?;

semver::Version::parse(&out).context("cannot parse version")
}
Expand Down

0 comments on commit 1a7899d

Please sign in to comment.