From d7d9e3c3230e7518bdedeb9a12c70bd2124b2ff6 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 5 Jan 2024 08:03:42 +0900 Subject: [PATCH] dev: support Podman --- neko/update/docker.sh | 6 +++--- update.sh | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/neko/update/docker.sh b/neko/update/docker.sh index 2abda049..6af3f41a 100755 --- a/neko/update/docker.sh +++ b/neko/update/docker.sh @@ -5,16 +5,16 @@ set -eu pull() { say 'Pulling the image...' - run 'docker pull registry.code.naskya.net/naskya/firefish' + run "$1 pull registry.code.naskya.net/naskya/firefish" } -if ! pull; then +if ! pull "$1"; then say 'awawa, the image may not be compatible with your environment...' say 'Gonnya try building the image locally!' say 'It takes some time! Why not brew a cup of cofe?' run "$(cat - << EOC -docker build --tag registry.code.naskya.net/naskya/firefish --build-arg VERSION="$(version)" . +$1 build --tag registry.code.naskya.net/naskya/firefish --build-arg VERSION="$(version)" . EOC )" fi diff --git a/update.sh b/update.sh index c572fb5a..f6bbfca8 100755 --- a/update.sh +++ b/update.sh @@ -74,13 +74,16 @@ for message in neko/messages/*; do esac done -say 'Do you use Docker?' -printf '[y/N] > ' +say 'Do you use Docker or Podman?' +printf '(d: Docker, p: Podman, n: No) [d/p/N] > ' read -r yn case "${yn}" in - [Yy]|[Yy][Ee][Ss]) - ./neko/update/docker.sh "$@" + [Dd]) + ./neko/update/docker.sh 'docker' "$@" + ;; + [Pp]) + ./neko/update/docker.sh 'podman' "$@" ;; *) ./neko/update/native.sh "$@"