Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ridhwaans committed Apr 11, 2024
1 parent 395cf09 commit 5b3b533
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
6 changes: 2 additions & 4 deletions src/base/modules/common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/base/modules/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 0 additions & 7 deletions src/base/modules/ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 6 additions & 8 deletions test/base/common-utils.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions test/base/language-versions.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5b3b533

Please sign in to comment.