Last active
July 20, 2018 16:22
-
-
Save jonmackenzie/cca196501f0fca6ee4146ccdb6c102b8 to your computer and use it in GitHub Desktop.
script for doing dotfile/ config stuff, script for installing zsh without root. I highly recommend not running any of this if you don't know what it's doing. Because if you knew what it's doing, you would not run it. http://cs.smu.ca/~j_mackenzie/config/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted from https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ | |
echo -e "\n\n\n\n==================================================" | |
echo -e "SETTING UP CONFIG" | |
echo -e "==================================================\n\n\n\n" | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
echo -e ".cfg" >> .gitignore | |
git clone --bare https://github.com/jonmackenzie/dotfiles/ $HOME/.cfg | |
echo -e "\n\n\n\n==================================================" | |
echo -e "MOVING ANY EXISTING DOTFILES TO .config-backup" | |
echo -e "==================================================\n\n\n\n" | |
mkdir .config-backup | |
mv .tmux* .config-backup | |
mv .vim* .config-backup | |
mv .gitmodules .config-backup | |
mv .zsh* .config-backup | |
mv README.md .config-backup | |
echo -e "\n\n\n\n==================================================" | |
echo -e "CHECKING OUT REPO" | |
echo -e "==================================================\n\n\n\n" | |
mkdir -p .config-backup | |
config checkout | |
config config status.showUntrackedFiles no | |
echo -e "\n\n\n\n==================================================" | |
echo -e "INSTALLING OH-MY-ZSH " | |
echo -e "==================================================\n\n\n\n" | |
# install oh-my-zsh, keeping the .zshrc from the repo and replacing the auto-generated one with it | |
mv .zshrc newzshrc | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" || sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" | |
mv newzshrc .zshrc | |
echo -e "\n\n\n\n==================================================" | |
echo -e "CLONING SUBMODULES" | |
echo -e "==================================================\n\n\n\n" | |
config submodule init | |
config submodule update | |
echo -e "\n\n\n\nDONE\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# downloads and installs zsh in the user's dir, no root required | |
cd ~ | |
wget -O zsh.tar.gz https://sourceforge.net/projects/zsh/files/latest/download | |
mkdir zsh && tar -xvzf zsh.tar.gz -C zsh --strip-components 1 | |
cd zsh | |
./configure --prefix=$HOME | |
make | |
make install | |
cd ~ | |
rm zsh.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment