mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-18 16:26:50 +00:00
bootstrap new install
This commit is contained in:
parent
e2af9cdb1b
commit
4485093402
2 changed files with 43 additions and 3 deletions
40
bootstrap.sh
Normal file
40
bootstrap.sh
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# git pull origin master;
|
||||
|
||||
function doIt() {
|
||||
rsync --exclude ".git/" \
|
||||
--exclude ".github/" \
|
||||
-avh --no-perms . ~;
|
||||
if [ ! -d "${HOME}/.oh-my-zsh" ]; then
|
||||
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
fi
|
||||
if [ ! -d "${HOME}/.oh-my-zsh/custom/themes/powerlevel9k" ]; then
|
||||
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
|
||||
fi
|
||||
if [ -d "${HOME}/.zsh" ]; then
|
||||
rm -rf $HOME/.zsh
|
||||
fi
|
||||
cp -r .zsh/ $HOME
|
||||
if [ -n "${devTools}" ]; then
|
||||
sed -i "s%export devTools=\"\"%export devTools=\"$devTools\"%g" $HOME/.zsh/env.zsh
|
||||
fi
|
||||
if [ -n "${GOPATH}" ]; then
|
||||
sed -i "s%\#export GOPATH=\"\"%export GOPATH=\"$GOPATH\"%g" $HOME/.zsh/env.zsh
|
||||
fi
|
||||
if [ -n "${ANDROID_SDK_ROOT}" ]; then
|
||||
sed -i "s%\#export ANDROID_SDK_ROOT=\"\"%export ANDROID_SDK_ROOT=\"$ANDROID_SDK_ROOT\"%g" $HOME/.zsh/env.zsh
|
||||
fi
|
||||
source $HOME/.zshrc
|
||||
}
|
||||
|
||||
if [ "$1" == "--force" -o "$1" == "-f" ]; then
|
||||
doIt;
|
||||
else
|
||||
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
|
||||
echo "";
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
doIt;
|
||||
fi;
|
||||
fi;
|
||||
unset doIt;
|
|
@ -20,7 +20,7 @@ fi
|
|||
if [ -n "${ANDROID_SDK_ROOT}" ]; then
|
||||
sed -i "s%\#export ANDROID_SDK_ROOT=\"\"%export ANDROID_SDK_ROOT=\"$ANDROID_SDK_ROOT\"%g" $HOME/.zsh/env.zsh
|
||||
fi
|
||||
if [ ! -d "${HOME}/.dotfiles" ]; then
|
||||
git clone --bare git@github.com:mlunax/dotfiles.git $HOME/.dotfiles
|
||||
fi
|
||||
# if [ ! -d "${HOME}/.dotfiles" ]; then
|
||||
# git clone --bare git@github.com:mlunax/dotfiles.git $HOME/.dotfiles
|
||||
# fi
|
||||
source $HOME/.zshrc
|
||||
|
|
Loading…
Add table
Reference in a new issue