File tree Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -551,9 +551,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
551551
552552 # Add devcontainer .zshrc template
553553 if [ " $INSTALL_OH_MY_ZSH_CONFIG " = " true" ]; then
554- if [ -f " ${template_path} " ] && grep -qF " $( head -n 1 " ${template_path} " ) " " ${user_rc_file} " ; then
555- echo " No need to overwrite existing .zshrc file with the template file."
556- else
554+ if ! [ -f " ${template_path} " ] || ! grep -qF " $( head -n 1 " ${template_path} " ) " " ${user_rc_file} " ; then
557555 echo -e " $( cat " ${template_path} " ) \nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
558556 fi
559557 sed -i -e ' s/ZSH_THEME=.*/ZSH_THEME="devcontainers"/g' ${user_rc_file}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # Optional: Import test library
6+ source dev-container-features-test-lib
7+
8+ # Definition specific tests
9+ check " configure-zshrc-without-overwrite" bash -c " grep 'rbenv init -' ~/.zshrc"
10+
11+ # Report result
12+ reportResults
Original file line number Diff line number Diff line change 1+ FROM mcr.microsoft.com/devcontainers/ruby:3.2
2+
3+ RUN echo 'eval "$(rbenv init -)"' >> /home/vscode/.zshrc
4+
Original file line number Diff line number Diff line change 235235 }
236236 }
237237 },
238+ "devcontainer-ruby-zshrc" : {
239+ "build" : {
240+ "dockerfile" : " Dockerfile"
241+ },
242+ "remoteUser" : " vscode" ,
243+ "features" : {
244+ "common-utils" : {
245+ "installZsh" : true ,
246+ "username" : " vscode" ,
247+ "userUid" : " 1000" ,
248+ "userGid" : " 1000" ,
249+ "upgradePackages" : true ,
250+ "installOhMyZsh" : true ,
251+ "installOhMyZshConfig" : true ,
252+ "configureZshAsDefaultShell" : true
253+ }
254+ }
255+ },
238256 "alpine-base-zsh-default" : {
239257 "image" : " mcr.microsoft.com/devcontainers/base:alpine" ,
240258 "remoteUser" : " vscode" ,
You can’t perform that action at this time.
0 commit comments