1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

shellcheck: simplify install-nix-from-tarball.sh

This commit is contained in:
Anatoli Babenia 2024-11-27 17:11:36 +03:00
parent bb1a1fdb60
commit 37fd80588f
2 changed files with 5 additions and 11 deletions

View file

@ -496,7 +496,6 @@
''^scripts/create-darwin-volume\.sh$'' ''^scripts/create-darwin-volume\.sh$''
''^scripts/install-darwin-multi-user\.sh$'' ''^scripts/install-darwin-multi-user\.sh$''
''^scripts/install-multi-user\.sh$'' ''^scripts/install-multi-user\.sh$''
''^scripts/install-nix-from-tarball\.sh$''
''^scripts/install-systemd-multi-user\.sh$'' ''^scripts/install-systemd-multi-user\.sh$''
''^src/nix/get-env\.sh$'' ''^src/nix/get-env\.sh$''
''^tests/functional/ca/build-dry\.sh$'' ''^tests/functional/ca/build-dry\.sh$''

View file

@ -48,15 +48,14 @@ case "$(uname -s)" in
INSTALL_MODE=no-daemon;; INSTALL_MODE=no-daemon;;
esac esac
# space-separated string ACTION=
ACTIONS=
# handle the command line flags # handle the command line flags
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case $1 in case $1 in
--daemon) --daemon)
INSTALL_MODE=daemon INSTALL_MODE=daemon
ACTIONS="${ACTIONS}install " ACTION=install
;; ;;
--no-daemon) --no-daemon)
if [ "$(uname -s)" = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
@ -65,18 +64,14 @@ while [ $# -gt 0 ]; do
fi fi
INSTALL_MODE=no-daemon INSTALL_MODE=no-daemon
# intentional tail space # intentional tail space
ACTIONS="${ACTIONS}install " ACTION=install
;; ;;
# --uninstall)
# # intentional tail space
# ACTIONS="${ACTIONS}uninstall "
# ;;
--yes) --yes)
export NIX_INSTALLER_YES=1;; export NIX_INSTALLER_YES=1;;
--no-channel-add) --no-channel-add)
export NIX_INSTALLER_NO_CHANNEL_ADD=1;; export NIX_INSTALLER_NO_CHANNEL_ADD=1;;
--daemon-user-count) --daemon-user-count)
export NIX_USER_COUNT=$2 export NIX_USER_COUNT="$2"
shift;; shift;;
--no-modify-profile) --no-modify-profile)
NIX_INSTALLER_NO_MODIFY_PROFILE=1;; NIX_INSTALLER_NO_MODIFY_PROFILE=1;;
@ -128,7 +123,7 @@ done
if [ "$INSTALL_MODE" = "daemon" ]; then if [ "$INSTALL_MODE" = "daemon" ]; then
printf '\e[1;31mSwitching to the Multi-user Installer\e[0m\n' printf '\e[1;31mSwitching to the Multi-user Installer\e[0m\n'
exec "$self/install-multi-user" $ACTIONS # let ACTIONS split exec "$self/install-multi-user" $ACTION
exit 0 exit 0
fi fi