Skip to content

Commit

Permalink
Fix append in Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Sep 10, 2020
1 parent 1fe3abf commit 03ac172
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ test_suite() {
echo "Test: ~/.zshrc was generated" && assert_contain "$ZSHRC" 'ZSH="/root/.oh-my-zsh"' "!"
echo "Test: theme was configured" && assert_contain "$ZSHRC" 'ZSH_THEME="agnoster"' "!"
echo "Test: plugins were configured" && assert_contain "$ZSHRC" 'plugins=(git git-auto-fetch zsh-autosuggestions zsh-completions )' "!"
echo "Test: lines are appended to ~/.zshrc" && assert_contain "$ZSHRC" 'CASE_SENSITIVE="true"' "!" && assert_contain "$ZSHRC" 'HYPHEN_INSENSITIVE="true"' "!"
echo "Test: line 1 is appended to ~/.zshrc" && assert_contain "$ZSHRC" 'CASE_SENSITIVE="true"' "!"
echo "Test: line 2 is appended to ~/.zshrc" && assert_contain "$ZSHRC" 'HYPHEN_INSENSITIVE="true"' "!"
echo "Test: newline is expanded when append lines" && assert_not_contain "$ZSHRC" '\nCASE_SENSITIVE="true"' "!"

echo
echo "######### Success! All tests are passing for ${image_name}"
Expand Down
6 changes: 5 additions & 1 deletion zsh-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ plugins=($_PLUGINS)
source \$ZSH/oh-my-zsh.sh
EOM
echo $ZSHRC_APPEND
printf $ZSHRC_APPEND
}

powerline10k_config() {
Expand All @@ -119,10 +119,12 @@ install_dependencies

cd /tmp

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

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

# Generate .zshrc
zshrc_template "$HOME" "$THEME" "$plugin_list" > $HOME/.zshrc

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

0 comments on commit 03ac172

Please sign in to comment.