forked from DGNum/colmena
parent
fbf25faa24
commit
b8bdf5824c
2 changed files with 4 additions and 10 deletions
|
@ -93,7 +93,7 @@ impl HivePath {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Self::Legacy(path.to_owned()))
|
Ok(Self::Legacy(path.canonicalize()?))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn context_dir(&self) -> Option<PathBuf> {
|
fn context_dir(&self) -> Option<PathBuf> {
|
||||||
|
|
12
src/util.rs
12
src/util.rs
|
@ -221,11 +221,13 @@ pub async fn hive_from_args(args: &ArgMatches) -> ColmenaResult<Hive> {
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let path = args.value_of("config").expect("The config arg should exist").to_owned();
|
let path = args.value_of("config").expect("The config arg should exist").to_owned();
|
||||||
let fpath = canonicalize_cli_path(&path);
|
let fpath = PathBuf::from(&path);
|
||||||
|
|
||||||
if !fpath.exists() && path.contains(':') {
|
if !fpath.exists() && path.contains(':') {
|
||||||
// Treat as flake URI
|
// Treat as flake URI
|
||||||
let flake = Flake::from_uri(path).await?;
|
let flake = Flake::from_uri(path).await?;
|
||||||
|
log::info!("Using flake: {}", flake.uri());
|
||||||
|
|
||||||
let hive_path = HivePath::Flake(flake);
|
let hive_path = HivePath::Flake(flake);
|
||||||
let mut hive = Hive::new(hive_path)?;
|
let mut hive = Hive::new(hive_path)?;
|
||||||
|
|
||||||
|
@ -276,14 +278,6 @@ The list is comma-separated and globs are supported. To match tags, prepend the
|
||||||
.takes_value(true))
|
.takes_value(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn canonicalize_cli_path(path: &str) -> PathBuf {
|
|
||||||
if !path.starts_with('/') {
|
|
||||||
format!("./{}", path).into()
|
|
||||||
} else {
|
|
||||||
path.into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn capture_stream<R>(mut stream: BufReader<R>, job: Option<JobHandle>, stderr: bool) -> ColmenaResult<String>
|
pub async fn capture_stream<R>(mut stream: BufReader<R>, job: Option<JobHandle>, stderr: bool) -> ColmenaResult<String>
|
||||||
where R: AsyncRead + Unpin
|
where R: AsyncRead + Unpin
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue