aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/devcontainer-feature.json (renamed from src/common/feature.json)39
-rw-r--r--src/common/install.sh22
2 files changed, 36 insertions, 25 deletions
diff --git a/src/common/feature.json b/src/common/devcontainer-feature.json
index d6b94f2..318d0cf 100644
--- a/src/common/feature.json
+++ b/src/common/devcontainer-feature.json
@@ -3,42 +3,53 @@
"name": "common",
"description": "common",
"options": {
- "installZsh": {
+ "install_Zsh": {
"type": "boolean",
"default": true,
"description": "Install ZSH?"
},
- "installOhMyZsh": {
+ "install_Oh_My_Zsh": {
"type": "boolean",
"default": true,
"description": "Install Oh My Zsh!?"
},
- "upgradePackages": {
- "type":"boolean",
+ "upgrade_packages": {
+ "type": "boolean",
"default": true,
"description": "Upgrade OS packages?"
},
"username": {
- "type":"string",
- "proposals": ["vscode", "codespace", "none", "automatic"],
+ "type": "string",
+ "proposals": [
+ "vscode",
+ "codespace",
+ "none",
+ "automatic"
+ ],
"default": "automatic",
"description": "Enter name of non-root user to configure or none to skip"
},
- "uid": {
- "type":"string",
- "proposals": ["1000", "automatic"],
+ "user_uid": {
+ "type": "string",
+ "proposals": [
+ "1000",
+ "automatic"
+ ],
"default": "automatic",
"description": "Enter uid for non-root user"
},
- "gid": {
+ "user_gid": {
"type": "string",
- "proposals": ["1000", "automatic"],
+ "proposals": [
+ "1000",
+ "automatic"
+ ],
"default": "automatic",
"description": "Enter gid for non-root user"
},
- "nonFreePackages": {
- "type":"boolean",
- "default": true,
+ "add_non_free_packages": {
+ "type": "boolean",
+ "default": false,
"description": "Add packages from non-free Debian repository?"
}
},
diff --git a/src/common/install.sh b/src/common/install.sh
index 77c64db..ab8adb0 100644
--- a/src/common/install.sh
+++ b/src/common/install.sh
@@ -6,18 +6,17 @@
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
# Maintainer: The VS Code and Codespaces Teams
-#
-# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My Zsh! flag] [Add non-free packages]
set -e
-INSTALL_ZSH=${1:-"true"}
-USERNAME=${2:-"automatic"}
-USER_UID=${3:-"automatic"}
-USER_GID=${4:-"automatic"}
-UPGRADE_PACKAGES=${5:-"true"}
-INSTALL_OH_MYS=${6:-"true"}
-ADD_NON_FREE_PACKAGES=${7:-"false"}
+INSTALL_ZSH=${INSTALL_ZSH:-"true"}
+INSTALL_OH_MY_ZSH=${INSTALL_OH_MY_ZSH:-"true"}
+UPGRADE_PACKAGES=${UPGRADE_PACKAGES:-"true"}
+USERNAME=${USERNAME:-"automatic"}
+USER_UID=${USER_UID:-"automatic"}
+USER_GID=${USER_GID:-"automatic"}
+ADD_NON_FREE_PACKAGES=${ADD_NON_FREE_PACKAGES:-"false"}
+
SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
@@ -35,7 +34,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
- for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
+ for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
@@ -85,6 +84,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
net-tools \
psmisc \
curl \
+ tree \
wget \
rsync \
ca-certificates \
@@ -376,7 +376,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
# 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"
- if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then
+ if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MY_ZSH}" = "true" ]; then
template_path="${oh_my_install_dir}/templates/zshrc.zsh-template"
user_rc_file="${user_rc_path}/.zshrc"
umask g-w,o-w