1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 12:06:45 +00:00

fix: safely handle sparse/empty arrays with set -u in install.sh

This commit is contained in:
Tw93
2025-12-31 11:58:27 +08:00
parent 0ad1573aef
commit 01eff633e8

View File

@@ -266,8 +266,9 @@ parse_args() {
;;
esac
done
# Use ${args[@]+...} pattern to safely handle sparse/empty arrays with set -u
if [[ ${#args[@]} -gt 0 ]]; then
set -- "${args[@]}"
set -- ${args[@]+"${args[@]}"}
else
set --
fi