feat: reintroduce per container config
This commit is contained in:
5
devc.sh
5
devc.sh
@@ -34,6 +34,10 @@ default_args() {
|
|||||||
# Mount the ssh socket to get ssh commands working.
|
# Mount the ssh socket to get ssh commands working.
|
||||||
[ -e "$SSH_AUTH_SOCK" ] && arg "-v $SSH_AUTH_SOCK:/run/user/1000/ssh-auth-sock"
|
[ -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
|
# Add a volume for the home directory so it survives
|
||||||
# container updates.
|
# container updates.
|
||||||
arg "-v $name:/home/user:copy"
|
arg "-v $name:/home/user:copy"
|
||||||
@@ -70,6 +74,7 @@ fi
|
|||||||
# provided, use the last used name when possible.
|
# provided, use the last used name when possible.
|
||||||
if [[ $# -gt 0 ]] && [[ ${1:-} != -* ]]; then
|
if [[ $# -gt 0 ]] && [[ ${1:-} != -* ]]; then
|
||||||
name="$1"
|
name="$1"
|
||||||
|
mkdir -p "$script_dir/state"
|
||||||
echo "$name" >"$script_dir/state/last-name"
|
echo "$name" >"$script_dir/state/last-name"
|
||||||
shift
|
shift
|
||||||
elif [ -f "$script_dir/state/last-name" ]; then
|
elif [ -f "$script_dir/state/last-name" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user