-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·35 lines (33 loc) · 858 Bytes
/
dev.sh
File metadata and controls
executable file
·35 lines (33 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env sh
CONTAINER='bsp-to-taco'
IMAGE='docker.io/junikimm717/nvim2025:finch'
DIR="$(realpath "$(dirname "$0")")"
case "$1" in
pull|p)
podman pull "$IMAGE"
(podman container ls | grep "$CONTAINER" > /dev/null 2>&1) && podman container rm -fv "$CONTAINER"
;;
clear|c)
(podman container ls -a | grep "$CONTAINER" > /dev/null 2>&1)\
&& {
podman container kill "$CONTAINER" > /dev/null 2>&1;
podman container rm "$CONTAINER"
}
;;
*)
set +x
if ! (podman container ls -a | grep "$CONTAINER" > /dev/null 2>&1); then
podman run\
-dt\
--name "$CONTAINER"\
--group-add keep-groups\
-v "$DIR:/workspace"\
--privileged\
--rm\
"$IMAGE"
fi || exit 1
podman exec\
-e ENV=/root/.profile\
-it "$CONTAINER" /bin/bash
;;
esac