@@ 4,7 4,6 @@ main() (
data=$(tail -n +3 ~/devel/swaybar/states/container-updates.state)
dist_upgrade_targets=""
update_targets=""
- update_script="$HOME/devel/incus-scripts/update-containers/update-containers.sh"
while IFS= read -r line
do
@@ 22,13 21,36 @@ $data
EOF
if [ -n "${update_targets}" ]; then
- "${update_script}" "${update_targets}"
+ run_updates "${update_targets}"
fi
if [ -n "${dist_upgrade_targets}" ]; then
- "${update_script}" -d "${dist_upgrade_targets}"
+ run_dist_upgrades "${update_targets}"
fi
)
+
+run_updates() (
+ update_targets="${1-}"
+ update_script="$HOME/devel/incus-scripts/update-containers/update-containers.sh"
+
+ set -- "${update_targets}"
+
+ # shellcheck disable=SC2046
+ "${update_script}" $(printf "%s\n" "$@")
+)
+
+
+run_dist_upgrades() (
+ update_targets="${1-}"
+ update_script="$HOME/devel/incus-scripts/update-containers/update-containers.sh"
+
+ set -- "${update_targets}"
+
+ # shellcheck disable=SC2046
+ "${update_script}" -d $(printf "%s\n" "$@")
+)
+
+
main