Skip to content

Commit

Permalink
vim debugging
Browse files Browse the repository at this point in the history
continued

fix var expansion in vimrc EOF
  • Loading branch information
ridhwaans committed Apr 15, 2024
1 parent 6ee8bb3 commit c1d76fe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/base/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,7 @@ echo "Install took $elapsed seconds."
echo "elapsed=$elapsed" > .report
echo "ADJUSTED_ID=$ADJUSTED_ID" >> .report
echo "USERNAME=$USERNAME" >> .report
echo "UID=$UID" >> .report
echo "GID=$GID" >> .report

exit $?
8 changes: 6 additions & 2 deletions src/base/modules/common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ chsh -s /bin/zsh ${USERNAME}
if [ "$ADJUSTED_ID" = "mac" ]; then
dscl . -read /Users/${USERNAME} UserShell
else
getent passwd $(USERNAME) | awk -F: '{ print $7 }'
getent passwd $USERNAME | awk -F: '{ print $7 }'
fi

echo "debugging username, uid, gid, shell"
cat /etc/passwd

# Install packages for appropriate OS
case "${ADJUSTED_ID}" in
"debian")
Expand Down Expand Up @@ -222,6 +225,7 @@ if [ "$ADJUSTED_ID" != "mac" ]; then
chmod -R 775 $(dirname $ZSHPLUG_PATH)
fi

echo "Installing system-wide plugin manager for vim..."
curl -fLo "${VIMPLUG_PATH}/autoload/plug.vim" --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
if [ "$ADJUSTED_ID" != "mac" ]; then
Expand Down Expand Up @@ -257,7 +261,7 @@ if [ "${UPDATE_RC}" = "true" ]; then
fi

vim_rc_snippet=$(cat <<EOF
let g:vim_plug_home = '$VIMPLUG_PATH'
let g:vim_plug_home="$VIMPLUG_PATH"
execute 'source ' . g:vim_plug_home . '/autoload/plug.vim'
call plug#begin(g:vim_plug_home . '/plugged')
Expand Down
6 changes: 3 additions & 3 deletions src/base/modules/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [ "${UPDATE_RC}" = "true" ]; then
fi

if [ "${NODE_VERSION}" != "" ]; then
su ${USERNAME} -c "umask 0002 && source ${NVM_DIR}/nvm.sh && nvm install '${NODE_VERSION}' && nvm alias default '${NODE_VERSION}'"
su ${USERNAME} -c "umask 0002 && . ${NVM_DIR}/nvm.sh && nvm install '${NODE_VERSION}' && nvm alias default '${NODE_VERSION}'"
fi

# Additional node versions to be installed but not be set as default.
Expand All @@ -56,11 +56,11 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
IFS=","
read -a additional_versions <<< "$ADDITIONAL_VERSIONS"
for version in "${additional_versions[@]}"; do
su ${USERNAME} -c "umask 0002 && source ${NVM_DIR}/nvm.sh && nvm install ${version}"
su ${USERNAME} -c "umask 0002 && . ${NVM_DIR}/nvm.sh && nvm install ${version}"
done

if [ "${NODE_VERSION}" != "" ]; then
su ${USERNAME} -c "umask 0002 && source ${NVM_DIR}/nvm.sh && nvm use default"
su ${USERNAME} -c "umask 0002 && . ${NVM_DIR}/nvm.sh && nvm use default"
fi
IFS=$OLDIFS
fi
Expand Down
1 change: 1 addition & 0 deletions test/base/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"base": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"remoteUser": "customUser",
"updateRemoteUserUID": false,
"features": {
"base": {
"username": "customUser",
Expand Down

0 comments on commit c1d76fe

Please sign in to comment.