fix: make cd expand variables regardless

This commit is contained in:
sxyazi 2024-11-25 23:29:31 +08:00
parent 4026cebd88
commit ab04ce5d77
No known key found for this signature in database

View file

@ -17,17 +17,21 @@ struct Opt {
impl From<Cmd> for Opt {
fn from(mut c: Cmd) -> Self {
let mut target = c.take_first().and_then(Data::into_url).unwrap_or_default();
Self {
interactive: c.bool("interactive"),
..Self::from(c.take_first().and_then(Data::into_url).unwrap_or_default())
}
}
}
impl From<Url> for Opt {
fn from(mut target: Url) -> Self {
if target.is_regular() {
target = Url::from(expand_path(&target));
}
Self { target, interactive: c.bool("interactive") }
Self { target, interactive: false }
}
}
impl From<Url> for Opt {
fn from(target: Url) -> Self { Self { target, interactive: false } }
}
impl Tab {
#[yazi_codegen::command]