diff options
Diffstat (limited to 'auto')
-rwxr-xr-x | auto/update.sh | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/auto/update.sh b/auto/update.sh index 35a073f..474004b 100755 --- a/auto/update.sh +++ b/auto/update.sh @@ -115,23 +115,25 @@ save_ver () { sed -i "s/PKG_VER=.*/PKG_VER=$ver/" repo/$name/$name.xibuild } -for pkg in $(ls repo); do - printf "${LIGHT_BLUE}%s " "$pkg" - case "$(get_type $pkg)" in - "git"|"none"|"pypi") - printf "${LIGHT_WHITE}skipped" - ;; - *) - cur="$(cur_ver $pkg)" - new="$(new_ver $pkg)" - - [ "$cur" = "$new" ] && - printf "${LIGHT_WHITE}%s ${CHECKMARK}" "$cur" || { - printf "${GREEN}%s > %s" "$cur" "$new" - save_ver "$pkg" "$new" - } - esac - printf "\n" -done - +update_pkg () { + for pkg in $@; do + printf "${LIGHT_BLUE}%s " "$pkg" + case "$(get_type $pkg)" in + "git"|"none"|"pypi") + printf "${LIGHT_WHITE}skipped" + ;; + *) + cur="$(cur_ver $pkg)" + new="$(new_ver $pkg)" + + [ "$cur" = "$new" ] && + printf "${LIGHT_WHITE}%s ${CHECKMARK}" "$cur" || { + printf "${GREEN}%s > %s" "$cur" "$new" + save_ver "$pkg" "$new" + } + esac + printf "\n" + done +} +[ -z "$*" ] && update_pkg $(ls repo) || update_pkg $@ |