Skip to content

Commit e362724

Browse files
committed
Try to fix github ci
1 parent 519af48 commit e362724

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/environment_info.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use netcorehost::{
22
hostfxr::{EnvironmentInfo, FrameworkInfo, SdkInfo},
33
nethost,
44
};
5-
use std::{collections::HashMap, path::PathBuf, process::Command};
5+
use std::{collections::HashMap, path::{Path, PathBuf}, process::Command, str::FromStr};
66

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

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

0 commit comments

Comments
 (0)