mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
32 lines
427 B
Bash
Executable file
32 lines
427 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -eu
|
|
|
|
usage() {
|
|
echo example: $0 build samhain boot
|
|
}
|
|
|
|
build() {
|
|
HOST=$1
|
|
if [ $# -gt 2 ]; then
|
|
METHOD=$2
|
|
else
|
|
METHOD="switch"
|
|
fi
|
|
|
|
nix build -f . deploy.$HOST && ./result $METHOD
|
|
}
|
|
|
|
main() {
|
|
if [ $# -lt 2 ]; then
|
|
usage
|
|
else
|
|
CMD=$1
|
|
shift
|
|
|
|
if [[ $CMD == "build" ]]; then
|
|
build "$@"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
main "$@"
|