mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:39:42 +00:00
fix: safely handle sparse/empty arrays with set -u in install.sh
This commit is contained in:
@@ -266,8 +266,9 @@ parse_args() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
# Use ${args[@]+...} pattern to safely handle sparse/empty arrays with set -u
|
||||||
if [[ ${#args[@]} -gt 0 ]]; then
|
if [[ ${#args[@]} -gt 0 ]]; then
|
||||||
set -- "${args[@]}"
|
set -- ${args[@]+"${args[@]}"}
|
||||||
else
|
else
|
||||||
set --
|
set --
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user