feat: only do clone if not exists
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
784c7303a5
commit
cc70131101
@ -85,26 +85,37 @@ impl RootCommand {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if clone {
|
let project_path = self
|
||||||
let git_clone = self.app.git_clone();
|
.app
|
||||||
|
.config
|
||||||
|
.settings
|
||||||
|
.projects
|
||||||
|
.directory
|
||||||
|
.join(repo.to_rel_path());
|
||||||
|
if !project_path.exists() {
|
||||||
|
if clone {
|
||||||
|
let git_clone = self.app.git_clone();
|
||||||
|
|
||||||
if std::io::stdout().is_terminal() && shell {
|
if std::io::stdout().is_terminal() && shell {
|
||||||
let mut wrap_cmd =
|
let mut wrap_cmd =
|
||||||
InlineCommand::new(format!("cloning: {}", repo.to_rel_path().display()));
|
InlineCommand::new(format!("cloning: {}", repo.to_rel_path().display()));
|
||||||
let repo = repo.clone();
|
let repo = repo.clone();
|
||||||
wrap_cmd
|
wrap_cmd
|
||||||
.execute(move || async move {
|
.execute(move || async move {
|
||||||
git_clone.clone_repo(&repo, force_refresh).await?;
|
git_clone.clone_repo(&repo, force_refresh).await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
} else {
|
||||||
|
eprintln!("cloning repository...");
|
||||||
|
git_clone.clone_repo(&repo, force_refresh).await?;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
eprintln!("cloning repository...");
|
tracing::info!("skipping clone for repo: {}", &repo.to_rel_path().display());
|
||||||
git_clone.clone_repo(&repo, force_refresh).await?;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tracing::info!("skipping clone for repo: {}", &repo.to_rel_path().display());
|
tracing::info!("repository already exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
if shell {
|
if shell {
|
||||||
|
Loading…
Reference in New Issue
Block a user