david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

autopush by david@ghost

This commit is contained in:
david 2017-10-03 22:16:09 +02:00
parent b83f82795a
commit 37750eb8a3
1 changed files with 17 additions and 11 deletions

View File

@ -25,7 +25,7 @@ installdeps()
if [ $i -ne 0 ]; then
#checking for system
readonly systems="ubuntu arch"
readonly systems="ubuntu arch raspbian solus"
issue="$(cat /etc/issue)"
for item in $systems; do
echo $issue | grep -i $item
@ -41,8 +41,16 @@ installdeps()
arch)
sudo pacman -Su $missingdeps
;;
raspbian)
sudo apt-get update && sudo apt-get install -y $missingdeps
;;
solus)
sudo eopkg update-repo && sudo eopkg install $missingdeps
;;
?)
echo "unknown system. could not install anything"
echo "[myzsh]: i cannot install dependencies. unknown system."
exit 1
;;
esac
@ -58,7 +66,7 @@ installmyzsh()
choice="null"
while [ $choice != "y" ] && [ $choice != "n" ]; do
echo ""
read -p "should i clone myzsh writeable? [y/n]" choice
read -p "[myzsh]: should i clone myzsh writeable? [y/n]" choice
if [ $choice = "y" ]; then
git clone git@socialg.it:david/myzsh.git ~/.myzsh
else
@ -70,13 +78,11 @@ installmyzsh()
echo 'plugins=(david)' >> ~/.zshrc
echo 'source $ZSH/myzsh.sh' >> ~/.zshrc
echo "export PATH=$PATH" >> ~/.zshrc
# read -p "now modify your ~/.zshrc to your needs"
# vim ~/.zshrc
cat /etc/passwd | grep ~ | grep "/bin/zsh"
#set default shell if not set already
if [ $? -eq 1 ]; then
read -p "time to change your default shell to /bin/zsh"
read -p "[myzsh]: time to change your default shell to /bin/zsh"
sudo vim /etc/passwd
fi
@ -88,22 +94,22 @@ installmyzsh()
if [ -d ~/.myzsh ]; then
echo ""
echo "skipping myzsh installation. it is already there."
echo "[myzsh]: it seems i have already been setup."
echo ""
read -p "do you want to cleanup and reinstall? [y/n]" choice
read -p "[myzsh]: should i cleanup and reinstall? [y/n]" choice
if [ $choice = "y" ]; then
installdeps
removeohmyzsh
#removeohmyzsh
installmyzsh
else
echo "updating instead..."
echo "[myzsh]: updating instead."
cd ~/.myzsh
git pull origin master
cd -
fi
else
installdeps
removeohmyzsh
#removeohmyzsh
installmyzsh
fi