Skip to content

Commit

Permalink
migrate out of github repo and to bitbucket for all terminal settings…
Browse files Browse the repository at this point in the history
…, except the basic setup/uninstall scripts which need to be in github so that they're publicly available and can be run via a simple curl call
  • Loading branch information
smenzer committed Feb 19, 2020
1 parent 6cf8eff commit 6501302
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 99 deletions.
73 changes: 12 additions & 61 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,77 +1,28 @@
#!/bin/bash
# usage: bash <(curl -SsL https://raw.github.com/smenzer/terminal/master/setup.sh)

# get user inputs
repo="[email protected]:smenzer/terminal.git"
target_default="${HOME}/src/bitbucket.org"

# get machine name
read -r -p "Enter the machine name (hit Enter to use the default \"$(hostname)\"): " machine
if [ ! "${machine}" ]; then
machine=$(hostname)
fi

target_default=~/src/github.com/smenzer
read -r -p "Enter the target directory to place \"terminal\" (hit Enter to use the default \"${target_default}\"): " target
# get target directory
read -r -p "Enter the target directory to place \"terminal\" in (hit Enter to use the default \"${target_default}\"): " target
if [ ! "${target}" ]; then
target=${target_default}
fi
if [ ! -d "$target" ]; then
if [ ! -d "${target}" ]; then
mkdir -p ${target}
fi
# we don't want to create the terminal directory because git clone will do that for us
target=${target}"/terminal"


echo "--[ Cloning repo from [email protected]:smenzer/terminal.git"
git clone [email protected]:smenzer/terminal.git ${target}

echo "--[ Installing vim"
ln -s ${target}/vim ~/.vim
ln -s ${target}/vim/vimrc ~/.vimrc

pushd ${target}
echo "--[ Initialize submodules"
git submodule init
git submodule update
popd

echo "--[ Configuring git"
ln -s ${target}/git/gitignore_global ~/.gitignore_global
ln -s ${target}/git/gitconfig ~/.gitconfig

echo "--[ Linking bash profile to bash_profile_${machine}"
if [ ! -f ${target}/bash_profile/bash_profile_${machine} ]; then
cp ${target}/bash_profile/bash_profile_template ${target}/bash_profile/bash_profile_${machine}
fi
ln -s ${target}/bash_profile/bash_profile_${machine} ~/.bash_profile

echo "--[ Linking bash_common"
ln -s ${target}/bash_profile/bash_common ~/.bash_common

echo "--[ Creating .bash_secrets"
touch ~/.bash_secrets

echo "--[ Linking tmux"
ln -s ${target}/misc/tmux.conf ~/.tmux.conf

echo "--[ Linking ack"
ln -s ${target}/misc/ackrc ~/.ackrc

echo "--[ Linking vsqlrc"
ln -s ${target}/misc/vsqlrc ~/.vsqlrc

echo "--[ Linking git-prompt"
ln -s ${target}/git/git-prompt.sh .git-prompt.sh

echo "--[ Linking git-completion"
ln -s ${target}/git/git-completion.bash .git-completion.bash

echo "--[ Installing vim plugins"
vim +PluginInstall +qall

#echo "--[ YouCompleteMe setup"
#pushd ${target}/vim/bundle/YouCompleteMe/
#sh ./install.sh --clang-completer
#popd
target="${target}/terminal"

echo "--[ Installing iTerm2 shell integration"
curl -L https://iterm2.com/misc/install_shell_integration.sh | bash
echo "--[ Cloning repo from ${repo}"
# git clone ${repo} ${target}

echo "--[ Setup complete"
cd ${target}
bash ./setup.sh -m ${machine} -t ${target}
44 changes: 6 additions & 38 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
#!/bin/bash
# usage: bash <(curl -SsL https://raw.github.com/smenzer/terminal/master/uninstall.sh)
# note: will not remove the .bash_aliases file because it is not stored in git

# get user input
target_default=~/src/github.com/smenzer
target_default="${HOME}/src/bitbucket.org"

# get target directory
read -r -p "Enter the location of the \"terminal\" directory (hit Enter to use the default \"${target_default}\"): " target
if [ ! "${target}" ]; then
target=${target_default}
fi
target=${target}"/terminal"


# remove all links and finall the target directory
echo "--[ Uninstalling vim"
rm ~/.vim
rm ~/.vimrc

echo "--[ Uninstalling git"
rm ~/.gitignore_global
rm ~/.gitconfig

echo "--[ Uninstalling bash profile"
rm ~/.bash_profile

echo "--[ Uninstalling bash_common"
rm ~/.bash_common

echo "--[ .bash_aliases NOT removed"

echo "--[ Uninstalling tmux"
rm ~/.tmux.conf

echo "--[ Uninstalling ack"
rm ~/.ackrc

echo "--[ Uninstalling vsqlrc"
rm ~/.vsqlrc

echo "--[ Uninstalling git-prompt"
rm ~/.git-prompt.sh

echo "--[ Uninstalling terminal repository from ${target}"
rm -rf ${target}


echo "--[ Uninstallation complete!"
# run the uninstall from there
cd ${target}
bash ./uninstall.sh -t ${target}

0 comments on commit 6501302

Please sign in to comment.