1
0
Fork 0

Compare commits

..

2 commits

View file

@ -31,10 +31,10 @@ function usage() {
function run_operation { function run_operation {
options="--flake $flakeDir $remainingArgs --use-remote-sudo --log-format multiline-with-logs" options="--flake $flakeDir $remainingArgs --use-remote-sudo --log-format multiline-with-logs"
echo "Running this operation: nixos-rebuild $1 $options" echo "Running this operation: nixos-rebuild $1 $options"
nixos-rebuild $operation $options nixos-rebuild $operation $options
} }
# Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash # Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
POSITIONAL_ARGS=() POSITIONAL_ARGS=()
@ -73,7 +73,7 @@ done
remainingArgs=${POSITIONAL_ARGS[@]} remainingArgs=${POSITIONAL_ARGS[@]}
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [ -n "${flakeDir}" ]; then if [ -z "${flakeDir}" ]; then
echo "Flake directory not specified. Use '--flake <path>' or set \$FLAKE_DIR." echo "Flake directory not specified. Use '--flake <path>' or set \$FLAKE_DIR."
exit 1 exit 1
fi fi