Compare commits

...

3 Commits

Author SHA1 Message Date
Adphi 0623a42f0e Mettre à jour 'tools/install.sh' 2018-07-15 09:24:47 +02:00
Adphi bd01d79bf0 Fix oh-my-zsh git link 2018-07-15 09:16:18 +02:00
Philippe-Adrien Nousse 117e00a55e original install script 2018-07-15 08:59:56 +02:00
1 changed files with 7 additions and 11 deletions

View File

@ -25,9 +25,8 @@ main() {
set -e set -e
if ! command -v zsh >/dev/null 2>&1; then if ! command -v zsh >/dev/null 2>&1; then
printf "${YELLOW}Zsh is not installed!${NORMAL} Installing zsh\n" printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
sudo apt-get install zsh -y exit
fi fi
if [ ! -n "$ZSH" ]; then if [ ! -n "$ZSH" ]; then
@ -40,9 +39,6 @@ main() {
exit exit
fi fi
printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
sudo apt-get install -y fonts-powerline
# Prevent the cloned repository from having insecure permissions. Failing to do # Prevent the cloned repository from having insecure permissions. Failing to do
# so causes compinit() calls to fail with "command not found: compdef" errors # so causes compinit() calls to fail with "command not found: compdef" errors
# for users with insecure umasks (e.g., "002", allowing group writability). Note # for users with insecure umasks (e.g., "002", allowing group writability). Note
@ -63,7 +59,7 @@ main() {
exit 1 exit 1
fi fi
fi fi
env git clone --depth=1 http://git.adphi.net/Adphi/oh-my-zsh.git $ZSH || { env git clone --depth=1 http://git.adphi.net/Adphi/oh-my-zsh.git "$ZSH" || {
printf "Error: git clone of oh-my-zsh repo failed\n" printf "Error: git clone of oh-my-zsh repo failed\n"
exit 1 exit 1
} }
@ -76,9 +72,9 @@ main() {
fi fi
printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n" printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
cp $ZSH/templates/zshrc.zsh-template ~/.zshrc cp "$ZSH"/templates/zshrc.zsh-template ~/.zshrc
sed "/^export ZSH=/ c\\ sed "/^export ZSH=/ c\\
export ZSH=$ZSH export ZSH=\"$ZSH\"
" ~/.zshrc > ~/.zshrc-omztemp " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc mv -f ~/.zshrc-omztemp ~/.zshrc
@ -112,7 +108,7 @@ main() {
echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.' echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.'
echo '' echo ''
printf "${NORMAL}" printf "${NORMAL}"
env zsh env zsh -l
} }
main main