Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pushing custom git repositories #574

Merged
merged 10 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update review comments
  • Loading branch information
savente93 committed Oct 13, 2023
commit d1bb5916b42ad8f4db5e7fdb4b538a3bc709a80a
5 changes: 1 addition & 4 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@
# Don't pull the predefined git repos
#pull_predefined = false

# Also push custom repositories
#push_custom = false

# Arguments to pass Git when pulling repositories
#arguments = "--rebase --autostash"
#pull_arguments = "--rebase --autostash"

# Also push custom repositories
#push_custom_repos = true
Expand Down
6 changes: 3 additions & 3 deletions src/steps/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async fn push_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) -

let output = command.output().await?;
let result = match output.status.success() {
true => Ok(output.stdout),
true => Ok(()),
false => Err(format!("Failed to push {repo}")),
};

Expand Down Expand Up @@ -223,7 +223,7 @@ impl Git {
.iter()
.for_each(|pattern| print_warning(format!("Path {pattern} did not contain any git repositories")));

if repositories.pull_repositories.is_empty() && repositories.push_repositories.is_empty() {
if repositories.is_empty() {
return Err(SkipStep(String::from("No repositories to pull or push")).into());
}

Expand All @@ -241,7 +241,7 @@ impl Git {
repositories
.pull_repositories
.iter()
.for_each(|repo| println!("Would push {}", &repo));
.for_each(|repo| println!("Would pull {}", &repo));

return Ok(());
}
Expand Down