mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
minor refactor
This commit is contained in:
parent
3193a40a95
commit
ebc9e9674f
3 changed files with 6 additions and 8 deletions
|
|
@ -73,7 +73,7 @@ impl FromStr for Dependency {
|
|||
use_: s.to_owned(),
|
||||
name: format!("{name}.yazi"),
|
||||
parent: format!("{parent}{}", if child.is_empty() { ".yazi" } else { "" }),
|
||||
child: child.to_owned(),
|
||||
child: if child.is_empty() { String::new() } else { format!("{child}.yazi") },
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,7 @@ use super::Dependency;
|
|||
|
||||
impl Dependency {
|
||||
pub(super) async fn deploy(&mut self) -> Result<()> {
|
||||
let from = if self.child.is_empty() {
|
||||
self.local().join(&self.child)
|
||||
} else {
|
||||
self.local().join(format!("{}.yazi", self.child))
|
||||
};
|
||||
let from = self.local().join(&self.child);
|
||||
|
||||
self.header("Deploying package `{name}`")?;
|
||||
self.is_flavor = maybe_exists(&from.join("flavor.toml")).await;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,10 @@ impl Git {
|
|||
}
|
||||
|
||||
async fn exec(f: impl FnOnce(&mut Command) -> &mut Command) -> Result<()> {
|
||||
let status =
|
||||
f(&mut Command::new("git")).status().await.context("Failed to execute `git` command")?;
|
||||
let status = f(Command::new("git").args(["-c", "advice.detachedHead=false"]))
|
||||
.status()
|
||||
.await
|
||||
.context("Failed to execute `git` command")?;
|
||||
|
||||
if !status.success() {
|
||||
bail!("`git` command failed: {status}");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue