mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +01:00
Update zsh_setup.sh to use bash functions
This commit is contained in:
parent
9a427ed79d
commit
ae9133b1c5
@ -1,36 +1,48 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "***************************************************"
|
###
|
||||||
echo 'Updating system packages... '
|
# Update system packages
|
||||||
echo "***************************************************"
|
update_system() {
|
||||||
sudo apt update && sudo apt upgrade -y
|
echo 'Updating system'
|
||||||
|
sudo apt-get update && sudo apt-get upgrade -y
|
||||||
|
sudo apt-get install -y git curl
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Install ZSH shell
|
||||||
|
install_zsh() {
|
||||||
|
echo 'Installing ZSH'
|
||||||
|
# Install and set zsh as shell
|
||||||
|
sudo apt-get install -y zsh
|
||||||
|
|
||||||
echo "***************************************************"
|
# Change shell to Zsh for the vagrant user
|
||||||
echo 'Checking Zsh installation... '
|
sudo chsh -s /bin/zsh vagrant
|
||||||
echo "***************************************************"
|
}
|
||||||
if ! dpkg -s zsh; then
|
|
||||||
# Install and set Zsh as shell
|
|
||||||
sudo apt install -y zsh
|
|
||||||
|
|
||||||
# Install Oh-My-Zsh!
|
###
|
||||||
|
# Install Oh My ZSH! plugin framework
|
||||||
|
install_ohmyzsh() {
|
||||||
|
echo "Installing Oh-My-ZSH!"
|
||||||
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
|
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
|
||||||
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
||||||
|
|
||||||
# Change the Oh-My-Zsh! default configuration.
|
# Change the Oh-My-Zsh! default configuration.
|
||||||
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="blinks"/g' ~/.zshrc
|
sed -i 's@ZSH_THEME="robbyrussell"@ZSH_THEME="blinks"@g' ~/.zshrc
|
||||||
sed -i 's/# CASE_SENSITIVE="true"/CASE_SENSITIVE="true"/g' ~/.zshrc
|
sed -i 's@# CASE_SENSITIVE="true"@CASE_SENSITIVE="true"@g' ~/.zshrc
|
||||||
sed -i 's/# COMPLETION_WAITING_DOTS="true"/COMPLETION_WAITING_DOTS="true"/g' ~/.zshrc
|
sed -i 's@# COMPLETION_WAITING_DOTS="true"@COMPLETION_WAITING_DOTS="true"@g' ~/.zshrc
|
||||||
sed -i 's/# DISABLE_UNTRACKED_FILES_DIRTY="true"/DISABLE_UNTRACKED_FILES_DIRTY="true"/g' ~/.zshrc
|
sed -i 's@# DISABLE_UNTRACKED_FILES_DIRTY="true"@DISABLE_UNTRACKED_FILES_DIRTY="true"@g' ~/.zshrc
|
||||||
sed -i 's/# HIST_STAMPS="mm/dd/yyyy"/HIST_STAMPS="yyyy-mm-dd"/g' ~/.zshrc
|
sed -i 's@# HIST_STAMPS="mm/dd/yyyy"@HIST_STAMPS="yyyy-mm-dd"@g' ~/.zshrc
|
||||||
sed -i 's/plugins=(git)/plugins=(git dirhistory common-aliases command-not-found ruby)/g' ~/.zshrc
|
sed -i 's@plugins=(git)@plugins=(git dirhistory common-aliases command-not-found ruby)@g' ~/.zshrc
|
||||||
|
|
||||||
# Include .profile settings
|
# Include .profile settings
|
||||||
echo ' ' >> ~/.zshrc
|
echo -e "\n# Include .profile settings" >> ~/.zshrc
|
||||||
echo '# Include .profile settings' >> ~/.zshrc
|
echo -e "source ~/.profile\n" >> ~/.zshrc
|
||||||
echo 'source ~/.profile' >> ~/.zshrc
|
}
|
||||||
echo ' ' >> ~/.zshrc
|
|
||||||
|
|
||||||
# Change shell to Zsh for the vagrant user
|
setup() {
|
||||||
sudo chsh -s /bin/zsh vagrant
|
update_system
|
||||||
fi
|
install_zsh
|
||||||
|
install_ohmyzsh
|
||||||
|
}
|
||||||
|
|
||||||
|
setup "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user