#!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-only set -euo pipefail if [[ $# -lt 1 ]]; then echo "ERROR: missing command to run" >&2 exit 1 fi c="dbx" d="$HOME/Developer" workdir="$(realpath "$PWD")" if [[ "$workdir" != "$d"* ]]; then workdir="$d" fi tty="tty" if [[ ! -t 0 || ! -t 1 ]]; then tty="tty=false" fi cmd="$1" shift podman start "$c" >/dev/null exec podman exec \ --detach-keys "" \ --interactive \ --"$tty" \ --user "$(id -u)" \ --workdir "$workdir" \ "$c" \ fish -c "exec '$cmd'"' $argv' -- "$@"