From e0f953b94ed7073c6d6091096063c1756042021d Mon Sep 17 00:00:00 2001 From: Job79 Date: Wed, 27 Aug 2025 21:16:03 +0200 Subject: [PATCH] fix: keep directory when entering container --- enter.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/enter.sh b/enter.sh index 3df0b30..4246ada 100755 --- a/enter.sh +++ b/enter.sh @@ -45,14 +45,14 @@ run_args() { arg "-v $name:/home/user:copy" # Add custom user configuration. - config_file="./containers/$name/config.sh" + config_file="$script_dir/containers/$name/config.sh" [ -f "${config_file}" ] && source "${config_file}" } ### MAIN ### -cd "$(dirname "$(realpath "$0")")" -name=$(<"./state/last-name") -registry=$(<"./state/registry") +script_dir="$(dirname "$(realpath "$0")")" +name=$(<"$script_dir/state/last-name") +registry=$(<"$script_dir/state/registry") pull=false while test $# -gt 0; do @@ -61,7 +61,7 @@ while test $# -gt 0; do -*) log "unknown argument '$1'" 'x' 31 ;; *) name="$1" - echo "$1" >"./state/last-name" + echo "$1" >"$script_dir/state/last-name" ;; esac shift