grab ohmyzsh during build time, check for install

This commit is contained in:
aptalca
2020-10-22 09:55:58 -04:00
parent 8a269aa62e
commit 4cd7a0b706
3 changed files with 31 additions and 10 deletions
+15 -6
View File
@@ -1,12 +1,21 @@
#!/usr/bin/with-contenv bash
# First install ZSH
# Install ZSH
echo "**** Installing zsh ****"
apt-get update && apt-get install -y \
zsh
# Install oh-my-zsh
sudo -u abc "git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh"
sudo -u abc "cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc"
# Install oh-my-zsh if not installed already
if [ -d /config/.oh-my-zsh ]; then
echo "**** Oh My Zsh is already installed. You can update it via \"omz update\" in terminal. ****"
elif [ -d /.oh-my-zsh ]; then
echo "**** Installing Oh My Zsh. You can update it via \"omz update\" in terminal. ****"
mv /.oh-my-zsh /config/.oh-my-zsh
cp /config/.oh-my-zsh/templates/zshrc.zsh-template /config/.zshrc
else
echo "**** It looks like Oh My Zsh was manually deleted after install. Please recreate the code-server container to reinstall Oh My Zsh. ****"
fi
# Setup shell as default
chsh -s $(which zsh) abc
chown -R abc:abc \
/config/.oh-my-zsh \
/config/.zshrc