Skip to content
Snippets Groups Projects
Commit dfc763c6 authored by nimrod's avatar nimrod
Browse files

Improvements for update-wb.

- Better detection of the current image in use, will update if the image
  was already downloaded.
- Kill all tmux instances, otherwise it keeps running and but
  malfunctions.
parent 123123fb
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ CONTAINER='workbench'
is_latest() {
podman image exists "$IMAGE" || return 1
toolbox run --container "$CONTAINER" true 2>/dev/null || return 1
current="$(podman image inspect "$IMAGE" --format '{{.Digest}}')"
current="$(podman container inspect "$CONTAINER" --format '{{ .Image }}')"
podman image pull --quiet "$IMAGE" > /dev/null
new="$(podman image inspect "$IMAGE" --format '{{.Digest}}')"
[ "$new" = "$current" ] || return 1
......@@ -16,6 +16,7 @@ is_latest() {
update() {
toolbox rm --force "$CONTAINER" 2>/dev/null || true
yes | podman image prune --filter 'label=com.github.containers.toolbox=true'
killall tmux || true
toolbox create --image "$IMAGE"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment