summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvsibille2022-07-14 14:14:24 -0500
committervsibille2022-07-14 14:14:24 -0500
commit0555b62e74ebb8c62378d494d6129002adf7281b (patch)
tree3bc235d8913249706307ead602fd98554d033719
parent9d9e1df774438d45656b7d5372c71e2e9a90757a (diff)
downloadaur-0555b62e74ebb8c62378d494d6129002adf7281b.tar.gz
Define try_update function
-rwxr-xr-xupdate_MAC_SDK.zsh10
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 $@