update semantics slightly
This commit is contained in:
parent
3c4db952ec
commit
e63159b5e3
1 changed files with 3 additions and 3 deletions
|
@ -10,9 +10,9 @@ use crate::config::RepoConfig;
|
|||
|
||||
#[tracing::instrument]
|
||||
pub async fn update_repo(repo: &RepoConfig) -> Result<ExitStatus> {
|
||||
match std::fs::metadata(&repo.path) {
|
||||
match std::fs::metadata(repo.path.join(".git")) {
|
||||
Ok(metadata) if metadata.is_dir() => {
|
||||
info!("directory exists, pulling");
|
||||
info!("repository exists, pulling");
|
||||
Command::new("git")
|
||||
.current_dir(&repo.path)
|
||||
.arg("pull")
|
||||
|
@ -24,7 +24,7 @@ pub async fn update_repo(repo: &RepoConfig) -> Result<ExitStatus> {
|
|||
}
|
||||
Ok(_) => Err(std::io::ErrorKind::NotADirectory.into()),
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
|
||||
info!("not found, cloning");
|
||||
info!("not a repository, cloning");
|
||||
Command::new("git")
|
||||
.arg("clone")
|
||||
.arg(&repo.url)
|
||||
|
|
Loading…
Reference in a new issue