Skip to content

Commit 03ac172

Browse files
committed
Fix append in Alpine
1 parent 1fe3abf commit 03ac172

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ test_suite() {
3333
echo "Test: ~/.zshrc was generated" && assert_contain "$ZSHRC" 'ZSH="/root/.oh-my-zsh"' "!"
3434
echo "Test: theme was configured" && assert_contain "$ZSHRC" 'ZSH_THEME="agnoster"' "!"
3535
echo "Test: plugins were configured" && assert_contain "$ZSHRC" 'plugins=(git git-auto-fetch zsh-autosuggestions zsh-completions )' "!"
36-
echo "Test: lines are appended to ~/.zshrc" && assert_contain "$ZSHRC" 'CASE_SENSITIVE="true"' "!" && assert_contain "$ZSHRC" 'HYPHEN_INSENSITIVE="true"' "!"
36+
echo "Test: line 1 is appended to ~/.zshrc" && assert_contain "$ZSHRC" 'CASE_SENSITIVE="true"' "!"
37+
echo "Test: line 2 is appended to ~/.zshrc" && assert_contain "$ZSHRC" 'HYPHEN_INSENSITIVE="true"' "!"
38+
echo "Test: newline is expanded when append lines" && assert_not_contain "$ZSHRC" '\nCASE_SENSITIVE="true"' "!"
3739

3840
echo
3941
echo "######### Success! All tests are passing for ${image_name}"

zsh-in-docker.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ plugins=($_PLUGINS)
102102
103103
source \$ZSH/oh-my-zsh.sh
104104
EOM
105-
echo $ZSHRC_APPEND
105+
printf $ZSHRC_APPEND
106106
}
107107

108108
powerline10k_config() {
@@ -119,10 +119,12 @@ install_dependencies
119119

120120
cd /tmp
121121

122+
# Install On-My-Zsh
122123
if [ ! -d $HOME/.oh-my-zsh ]; then
123124
sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended
124125
fi
125126

127+
# Generate plugin list
126128
plugin_list=""
127129
for plugin in $PLUGINS; do
128130
if [ "`echo $plugin | grep -E '^http.*'`" != "" ]; then
@@ -134,8 +136,10 @@ for plugin in $PLUGINS; do
134136
plugin_list="${plugin_list}$plugin_name "
135137
done
136138

139+
# Generate .zshrc
137140
zshrc_template "$HOME" "$THEME" "$plugin_list" > $HOME/.zshrc
138141

142+
# Install powerlevel10k if not other theme were specified
139143
if [ "$THEME" = "powerlevel10k/powerlevel10k" ]; then
140144
git clone https://github.com/romkatv/powerlevel10k $HOME/.oh-my-zsh/custom/themes/powerlevel10k
141145
powerline10k_config >> $HOME/.zshrc

0 commit comments

Comments
 (0)