install-nix.sh: fix shellcheck issues

This commit is contained in:
zimbatm 2021-11-17 23:02:06 +01:00
parent 732b0240d2
commit 21a5164e12
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7

View file

@ -37,7 +37,7 @@ installer_options=(
if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then if [[ $OSTYPE =~ darwin || -e /run/systemd/system ]]; then
installer_options+=( installer_options+=(
--daemon --daemon
--daemon-user-count `python -c 'import multiprocessing as mp; print(mp.cpu_count() * 2)'` --daemon-user-count "$(python -c 'import multiprocessing as mp; print(mp.cpu_count() * 2)')"
) )
else else
# "fix" the following error when running nix* # "fix" the following error when running nix*
@ -46,11 +46,11 @@ else
fi fi
if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
IFS=' ' read -r -a extra_installer_options <<< $INPUT_INSTALL_OPTIONS IFS=' ' read -r -a extra_installer_options <<< "$INPUT_INSTALL_OPTIONS"
installer_options=("${extra_installer_options[@]}" "${installer_options[@]}") installer_options=("${extra_installer_options[@]}" "${installer_options[@]}")
fi fi
echo "installer options: ${installer_options[@]}" echo "installer options: ${installer_options[*]}"
# There is --retry-on-errors, but only newer curl versions support that # There is --retry-on-errors, but only newer curl versions support that
until curl -o "$workdir/install" -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}" until curl -o "$workdir/install" -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"