From a9107929029a5dac1a40b18cae397720fa7f3f4a Mon Sep 17 00:00:00 2001 From: mobinmob Date: Fri, 23 Aug 2024 18:12:48 +0300 Subject: apkg-reposync: fix syncing twice, also minor presentation fix. --- apkg-reposync | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apkg-reposync') diff --git a/apkg-reposync b/apkg-reposync index 3507486..e1e14e3 100755 --- a/apkg-reposync +++ b/apkg-reposync @@ -42,7 +42,7 @@ sync_official() { find_default_remote "$dir_for_official_repo" find_current_branch "$dir_for_official_repo" git pull "$default_remote" "$current_branch" || die "Cannot pull from $default_remote/$current_branch for the ofixial repos" - if git pull "$default_remote" "$current_branch"; then printf "%s\n" "[~> Successfully synced the repo!]"; fi + [ "$?" = 0 ] && printf "%s\n" "[~> Successfully synced the repo!]" } sync_or_skip() { @@ -53,12 +53,12 @@ sync_or_skip() { find_default_remote "$r" find_current_branch "$r" git pull "$default_remote" "$current_branch" || die "Cannot pull from $default_remote/$current_branch" - else - printf "%s\n" "Repo in <$r> is not a git repo, skipping..." + else + printf "%s\n" "[~>Repo in <$r> is not a git repo, skipping...]" fi done } source_and_sanity_checks sync_official sync_or_skip -if sync_or_skip; then echo "[~> Repo(s) succesfully synced!]" && rm -f "temp_repos_file"; fi +[ "$?" = 0 ] && echo "[~> Repo(s) succesfully synced!]" && rm -f "temp_repos_file" -- cgit v1.2.3