fix: keep directory when entering container
This commit is contained in:
10
enter.sh
10
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
|
||||
|
||||
Reference in New Issue
Block a user