scripts/deploy: allow omitting the "host" argument

This commit is contained in:
2024-09-24 13:09:47 +00:00
parent 693251d901
commit 7c37b10332

View File

@@ -2,9 +2,10 @@
#!nix-shell -i bash -p bash -p rsync -p sane-scripts.sync-music
usage() {
echo "sync [flags ...] <host> [<host> ...] [passthrough flags ...]"
echo "sync [flags ...] [<host> [<host> ...]] [passthrough flags ...]"
echo "where:"
echo " host: all|desko|lappy|moby"
echo " - defaults to 'all' if omitted"
exit 1
}
@@ -100,7 +101,12 @@ parseArgs() {
;;
esac
done
passthruArgs+=("$@")
if [[ ${#hosts[@]} -eq 0 ]]; then
hosts+=(desko lappy moby)
fi
}
parseArgs "$@"