fix: tag support
This commit is contained in:
5
devc.sh
5
devc.sh
@@ -54,7 +54,7 @@ param_args() {
|
|||||||
arg "-e HOST_HOME=$HOME" # Use to translate paths.
|
arg "-e HOST_HOME=$HOME" # Use to translate paths.
|
||||||
arg "-e DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/bus'"
|
arg "-e DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/bus'"
|
||||||
;;
|
;;
|
||||||
-x11)
|
-x11) # Enable X11 support.
|
||||||
arg "-e DISPLAY=$DISPLAY"
|
arg "-e DISPLAY=$DISPLAY"
|
||||||
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
arg "-v /tmp/.X11-unix:/tmp/.X11-unix"
|
||||||
arg "-e XAUTHORITY=/run/user/1000/.Xauthority"
|
arg "-e XAUTHORITY=/run/user/1000/.Xauthority"
|
||||||
@@ -80,6 +80,7 @@ fi
|
|||||||
# provided, use the last used name when possible.
|
# provided, use the last used name when possible.
|
||||||
if [[ $# -gt 0 ]] && [[ ${1:-} != -* ]]; then
|
if [[ $# -gt 0 ]] && [[ ${1:-} != -* ]]; then
|
||||||
image="$1"
|
image="$1"
|
||||||
|
[[ "$image" != *:* ]] && image="$image:main"
|
||||||
echo "$image" >"$HOME/.local/share/devc-previous-container"
|
echo "$image" >"$HOME/.local/share/devc-previous-container"
|
||||||
shift
|
shift
|
||||||
elif [ -f "$HOME/.local/share/devc-previous-container" ]; then
|
elif [ -f "$HOME/.local/share/devc-previous-container" ]; then
|
||||||
@@ -95,7 +96,7 @@ name="${image%:*}"
|
|||||||
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
|
if [ "$(podman container inspect "$name" -f {{.State.Running}} 2>&1)" != 'true' ] || [[ $# -gt 0 ]]; then
|
||||||
log "starting devcontainer..."
|
log "starting devcontainer..."
|
||||||
podman container rm -f -t 0 "$name" 1>/dev/null
|
podman container rm -f -t 0 "$name" 1>/dev/null
|
||||||
podman run -td $(default_args) $(param_args $@) "$registry/$name"
|
podman run -td $(default_args) $(param_args $@) "$registry/$image"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
podman exec -it "$name" bash -l
|
podman exec -it "$name" bash -l
|
||||||
|
|||||||
Reference in New Issue
Block a user