Compare commits
2 commits
4294c03219
...
ee7bbcef94
Author | SHA1 | Date | |
---|---|---|---|
Aires | ee7bbcef94 | ||
Aires | e74407c674 |
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue