diff --git a/devc.sh b/devc.sh index 74e2309..6cba622 100755 --- a/devc.sh +++ b/devc.sh @@ -34,6 +34,10 @@ default_args() { # Mount the ssh socket to get ssh commands working. [ -e "$SSH_AUTH_SOCK" ] && arg "-v $SSH_AUTH_SOCK:/run/user/1000/ssh-auth-sock" + # Load custom configuration for container. + config_file="$script_dir/containers/$name/config.sh" + [ -f "${config_file}" ] && source "${config_file}" + # Add a volume for the home directory so it survives # container updates. arg "-v $name:/home/user:copy" @@ -70,6 +74,7 @@ fi # provided, use the last used name when possible. if [[ $# -gt 0 ]] && [[ ${1:-} != -* ]]; then name="$1" + mkdir -p "$script_dir/state" echo "$name" >"$script_dir/state/last-name" shift elif [ -f "$script_dir/state/last-name" ]; then