diff options
author | vsibille | 2022-07-14 14:14:24 -0500 |
---|---|---|
committer | vsibille | 2022-07-14 14:14:24 -0500 |
commit | 0555b62e74ebb8c62378d494d6129002adf7281b (patch) | |
tree | 3bc235d8913249706307ead602fd98554d033719 | |
parent | 9d9e1df774438d45656b7d5372c71e2e9a90757a (diff) | |
download | aur-0555b62e74ebb8c62378d494d6129002adf7281b.tar.gz |
Define try_update function
-rwxr-xr-x | update_MAC_SDK.zsh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/update_MAC_SDK.zsh b/update_MAC_SDK.zsh index 7f9ef795269f..904f876cf1f9 100755 --- a/update_MAC_SDK.zsh +++ b/update_MAC_SDK.zsh @@ -23,9 +23,8 @@ function sync_git(){ git push } -function main(){ - local ver=$(get_last_version) - [[ -z $ver ]] && echo "Can't retrieve online version" && return 1 +function try_update(){ + local ver=$1 local old_ver=$(awk -F= '/pkgver=/{print $2}' PKGBUILD) if [[ $ver == $old_ver ]]; then echo "Already up-to-date: version $ver" @@ -34,4 +33,9 @@ function main(){ fi } +function main(){ + local ver=$(get_last_version) + [[ -n $ver ]] && try_update $ver || echo "Can't retrieve online version" +} + cd $0:A:h && main $@ |