fix: keep directory when entering container

This commit is contained in:
Job
2025-08-27 21:16:03 +02:00
parent cfb894c2eb
commit e0f953b94e

View File

@@ -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