Skip to content

Commit

Permalink
create empty .zprofile is not present, and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshspicer committed Dec 6, 2023
1 parent b1dbc03 commit c3e721d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ fi

# Optionally configure zsh and Oh My Zsh!
if [ "${INSTALL_ZSH}" = "true" ]; then
if [ ! -f "${user_home}/.zprofile" ]; then
touch "${user_home}/.zprofile"
chown ${USERNAME}:${group_name} "${user_home}/.zprofile"
fi

if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then
if [ "${ADJUSTED_ID}" = "rhel" ]; then
global_rc_path="/etc/zshrc"
Expand Down
2 changes: 1 addition & 1 deletion test/common-utils/configure_zsh_as_default_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ check "default-shell-is-zsh" bash -c "getent passwd $(whoami) | awk -F: '{ print
check "default-zshrc-is-dev-container-template" bash -c "cat ~/.zshrc | grep ZSH_THEME | grep devcontainers"
check "zsh-path-contains-local-bin" zsh -l -c "echo $PATH | grep '/home/devcontainer/.local/bin'"

check "Ensure .zprofile is owned by remoteUser" bash -c "stat -c '%U' home/devcontainer/.zprofile | grep devcontainer"
check "Ensure .zprofile is owned by remoteUser" bash -c "stat -c '%U' /home/devcontainer/.zprofile | grep devcontainer"

# Report result
reportResults

0 comments on commit c3e721d

Please sign in to comment.