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"
|
arg "-v $name:/home/user:copy"
|
||||||
|
|
||||||
# Add custom user configuration.
|
# Add custom user configuration.
|
||||||
config_file="./containers/$name/config.sh"
|
config_file="$script_dir/containers/$name/config.sh"
|
||||||
[ -f "${config_file}" ] && source "${config_file}"
|
[ -f "${config_file}" ] && source "${config_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
### MAIN ###
|
### MAIN ###
|
||||||
cd "$(dirname "$(realpath "$0")")"
|
script_dir="$(dirname "$(realpath "$0")")"
|
||||||
name=$(<"./state/last-name")
|
name=$(<"$script_dir/state/last-name")
|
||||||
registry=$(<"./state/registry")
|
registry=$(<"$script_dir/state/registry")
|
||||||
pull=false
|
pull=false
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
@@ -61,7 +61,7 @@ while test $# -gt 0; do
|
|||||||
-*) log "unknown argument '$1'" 'x' 31 ;;
|
-*) log "unknown argument '$1'" 'x' 31 ;;
|
||||||
*)
|
*)
|
||||||
name="$1"
|
name="$1"
|
||||||
echo "$1" >"./state/last-name"
|
echo "$1" >"$script_dir/state/last-name"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in New Issue
Block a user