mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
20 lines
410 B
Rust
20 lines
410 B
Rust
use anyhow::Result;
|
|
use yazi_fs::must_exists;
|
|
|
|
use super::{Dependency, Git};
|
|
|
|
impl Dependency {
|
|
pub(super) async fn add(&mut self) -> Result<()> {
|
|
self.header("Upgrading package `{name}`")?;
|
|
|
|
let path = self.local();
|
|
if !must_exists(&path).await {
|
|
Git::clone(&self.remote(), &path).await?;
|
|
} else {
|
|
Git::pull(&path).await?;
|
|
};
|
|
|
|
self.rev = Git::hash(&path).await?;
|
|
self.deploy().await
|
|
}
|
|
}
|