mirror of
https://example.com
synced 2024-11-22 21:36:39 +09:00
dev: add ability to pass --docker, --podman, or --native to update.sh
passing more than one of these flags is not expected
This commit is contained in:
parent
0a29467541
commit
ddbf884cb5
2 changed files with 28 additions and 18 deletions
46
update.sh
46
update.sh
|
@ -69,25 +69,35 @@ for message in $(find neko/messages -type f ! -name '*.resolved' -print | sort);
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
say 'Do you use Docker or Podman?'
|
docker_update() {
|
||||||
printf 'd: Docker, p: Podman, n: No [d/p/N] > '
|
./neko/update/container.sh 'docker' "$@"
|
||||||
read -r resp
|
}
|
||||||
|
podman_update() {
|
||||||
|
./neko/update/container.sh 'podman' "$@"
|
||||||
|
}
|
||||||
|
native_update() {
|
||||||
|
./neko/update/native.sh "$@"
|
||||||
|
}
|
||||||
|
|
||||||
case "${resp}" in
|
if contains '--docker' "$@"; then docker_update "$@"
|
||||||
[Dd])
|
elif contains '--podman' "$@"; then podman_update "$@"
|
||||||
./neko/update/docker.sh 'docker' "$@"
|
elif contains '--native' "$@"; then native_update "$@"
|
||||||
;;
|
|
||||||
[Pp])
|
else
|
||||||
./neko/update/docker.sh 'podman' "$@"
|
say 'Do you use Docker or Podman?'
|
||||||
;;
|
printf 'd: Docker, p: Podman, n: No [d/p/N] > '
|
||||||
[Yy]|[Yy][Ee][Ss])
|
read -r resp
|
||||||
sadsay "Watch out! ${resp} is not a valid answer." >&2
|
|
||||||
exit 1
|
case "${resp}" in
|
||||||
;;
|
[Yy]|[Yy][Ee][Ss])
|
||||||
*)
|
sadsay "Watch out! ${resp} is not a valid answer." >&2
|
||||||
./neko/update/native.sh "$@"
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
[Dd]) docker_update "$@" ;;
|
||||||
|
[Pp]) podman_update "$@" ;;
|
||||||
|
*) native_update "$@" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
say 'Enjoy your sabakan life~'
|
say 'Enjoy your sabakan life~'
|
||||||
|
|
Loading…
Reference in a new issue