fix(packages/rebuild): fix array list indexing
This commit is contained in:
parent
17f814342c
commit
639660637d
1 changed files with 3 additions and 2 deletions
|
@ -11,7 +11,8 @@ pkgs.writeShellScriptBin "rebuild" # sh
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
REMOTE_HOSTS+="$1"
|
REMOTE_HOSTS+=("$1")
|
||||||
|
echo ''${REMOTE_HOSTS[@]}
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -25,7 +26,7 @@ pkgs.writeShellScriptBin "rebuild" # sh
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
if [ ''${#REMOTE_HOSTS[@]} -gt 0 ]; then
|
if [ ''${#REMOTE_HOSTS[@]} -gt 0 ]; then
|
||||||
for host in "$REMOTE_HOSTS"; do
|
for host in "''${REMOTE_HOSTS[@]}"; do
|
||||||
echo "Rebuilding $host..."
|
echo "Rebuilding $host..."
|
||||||
nixos-rebuild switch --flake .#"$host" --target-host "$host" --use-remote-sudo || {
|
nixos-rebuild switch --flake .#"$host" --target-host "$host" --use-remote-sudo || {
|
||||||
echo "Error: nixos-rebuild switch failed for $host. Check the output."
|
echo "Error: nixos-rebuild switch failed for $host. Check the output."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue