diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common-utils/devcontainer-feature.json | 7 | ||||
-rwxr-xr-x | src/common-utils/install.sh | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index 812e5e9..d2a97d6 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "1.1.6", + "version": "1.2.0", "name": "Common Debian Utilities", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", @@ -10,6 +10,11 @@ "default": true, "description": "Install ZSH?" }, + "configureZshAsDefaultShell": { + "type": "boolean", + "default": false, + "description": "Change default shell to ZSH?" + }, "installOhMyZsh": { "type": "boolean", "default": true, diff --git a/src/common-utils/install.sh b/src/common-utils/install.sh index 5530b96..eb0e624 100755 --- a/src/common-utils/install.sh +++ b/src/common-utils/install.sh @@ -13,6 +13,7 @@ set -e rm -rf /var/lib/apt/lists/* INSTALL_ZSH="${INSTALLZSH:-"true"}" +CONFIGURE_ZSH_AS_DEFAULT_SHELL="${CONFIGUREZSHASDEFAULTSHELL:-"false"}" INSTALL_OH_MY_ZSH="${INSTALLOHMYZSH:-"true"}" UPGRADE_PACKAGES="${UPGRADEPACKAGES:-"true"}" USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}" @@ -378,6 +379,12 @@ if [ "${INSTALL_ZSH}" = "true" ]; then ZSH_ALREADY_INSTALLED="true" fi + # Change shell of determined user + if [[ "${CONFIGURE_ZSH_AS_DEFAULT_SHELL}" == "true" ]]; then + chsh --shell /bin/zsh ${USERNAME} + fi + + # Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme. # See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script. oh_my_install_dir="${user_rc_path}/.oh-my-zsh" |