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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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"
}