Skip to content

Commit

Permalink
Try to fix github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Braunsperger committed Feb 2, 2024
1 parent 7ad4d19 commit 15d40de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/environment_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use netcorehost::{
hostfxr::{EnvironmentInfo, FrameworkInfo, SdkInfo},
nethost,
};
use std::{collections::HashMap, path::PathBuf, process::Command};
use std::{collections::HashMap, path::{Path, PathBuf}, process::Command, str::FromStr};

#[path = "common.rs"]
mod common;
Expand All @@ -21,7 +21,11 @@ fn get_dotnet_environment_info() {
}

fn get_expected_environment_info() -> EnvironmentInfo {
let output = Command::new("dotnet").arg("--info").output().unwrap();
let dotnet_path = option_env!("DOTNET_ROOT")
.map(|root| Path::new(root).join("dotnet"))
.unwrap_or_else(|| PathBuf::from_str("dotnet").unwrap());
dbg!(&dotnet_path);
let output = Command::new(dotnet_path).arg("--info").output().unwrap();
assert!(output.status.success());
let output = String::from_utf8_lossy(&output.stdout);

Expand Down

0 comments on commit 15d40de

Please sign in to comment.