diff --git a/src/base/modules/common-utils.sh b/src/base/modules/common-utils.sh index 9de676d..f019d9b 100755 --- a/src/base/modules/common-utils.sh +++ b/src/base/modules/common-utils.sh @@ -135,8 +135,7 @@ install_debian_packages() { apt upgrade -y --no-install-recommends apt autoremove -y - # Fix character not in range error before shell change - # https://github.com/ohmyzsh/ohmyzsh/issues/4786 + # Fix for https://github.com/ohmyzsh/ohmyzsh/issues/4786 if ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen > /dev/null; then echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen @@ -177,7 +176,6 @@ fi # Add sudo support for non-root user if [ "${USERNAME}" != "root" ]; then - mkdir -p /etc/sudoers.d echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME chmod 0440 /etc/sudoers.d/$USERNAME fi @@ -187,7 +185,7 @@ chsh -s /bin/zsh ${USERNAME} if [ "$ADJUSTED_ID" = "mac" ]; then dscl . -read /Users/${USERNAME} UserShell else - grep "^${USERNAME}:" /etc/passwd | cut -d: -f7 + getent passwd $(USERNAME) | awk -F: '{ print $7 }' fi # Install packages for appropriate OS diff --git a/src/base/modules/node.sh b/src/base/modules/node.sh index 2e1982f..6691cd5 100755 --- a/src/base/modules/node.sh +++ b/src/base/modules/node.sh @@ -24,6 +24,7 @@ if [ "$ADJUSTED_ID" != "mac" ]; then [ ! -d ${NVM_DIR} ] && git clone https://github.com/nvm-sh/nvm.git ${NVM_DIR} chown -R "root:nvm" "${NVM_DIR}" chmod -R g+rws "${NVM_DIR}" + #chmod g+x "${NVM_DIR}/nvm.sh" source ${NVM_DIR}/nvm.sh fi diff --git a/src/base/modules/ruby.sh b/src/base/modules/ruby.sh index b04cffa..5a53d99 100755 --- a/src/base/modules/ruby.sh +++ b/src/base/modules/ruby.sh @@ -52,13 +52,6 @@ if [ "$ADJUSTED_ID" != "mac" ]; then fi usermod -a -G rbenv ${USERNAME} - # Adjust ruby version if required - if [ "${RUBY_VERSION}" = "none" ]; then - RUBY_VERSION= - elif [ "${RUBY_VERSION}" = "latest" ]; then - RUBY_VERSION="3.2.2" - fi - umask 0002 [ ! -d ${RBENV_ROOT} ] && git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} chown -R "root:rbenv" ${RBENV_ROOT} diff --git a/test/base/common-utils.sh b/test/base/common-utils.sh index 46a3272..3b38e4d 100644 --- a/test/base/common-utils.sh +++ b/test/base/common-utils.sh @@ -1,26 +1,24 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash set -e # Optional: Import test library source dev-container-features-test-lib -source ~/.zshrc - ZSHPLUG_PATH="/usr/local/share/zsh/bundle" VIMPLUG_PATH="/usr/local/share/vim/bundle" -check "should be logged in as the created user" echo $LOGNAME | grep "vscode" +check "should be logged in as the created user" echo $(whoami) | grep "vscode" check "user should have a uid of 1000" echo $(id -nu 1000) | grep "vscode" +check "user shell should be zsh" bash -c "getent passwd $(whoami) | awk -F: '{ print $7 }' | grep '/bin/zsh'" check "user timezone should be UTC" echo $(date +%Z) | grep "UTC" -check "user lang should be UTF-8" echo $LANG | grep "en_US.UTF-8" -check "user shell should be zsh" sudo grep "^$LOGNAME:" /etc/passwd | cut -d: -f7 | grep "zsh" +# check "user lang should be UTF-8" echo $LANG | grep "en_US.UTF-8" check "zsh version" zsh --version check "vim version" vim --version | head -n 1 # Check plugin managers -check "check for zplug" zplug --version -check "check for vim-plug" ls -1 $VIMPLUG_PATH/autoload/plug.vim | wc -l +# check "check for zplug" zplug --version +# check "check for vim-plug" ls -1 $VIMPLUG_PATH/autoload/plug.vim | wc -l # Report result reportResults diff --git a/test/base/language-versions.sh b/test/base/language-versions.sh index 562067c..19f395e 100644 --- a/test/base/language-versions.sh +++ b/test/base/language-versions.sh @@ -1,12 +1,10 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash set -e # Optional: Import test library source dev-container-features-test-lib -source ~/.zshrc - # Check language managers check "check for nvm" nvm --version check "check for sdkman" sdk version