summaryrefslogtreecommitdiff
path: root/auto
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
committerdavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
commit0d37a1ef234c38b27faba43bc3a22f985d311deb (patch)
treedde8df9f508e7323c3d7df599ceade7705c40acd /auto
parentf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (diff)
Remove all firmware
Diffstat (limited to 'auto')
-rwxr-xr-xauto/update.sh40
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 $@