diff --git a/setup.sh b/setup.sh index b958800..177ce80 100644 --- a/setup.sh +++ b/setup.sh @@ -1,77 +1,28 @@ #!/bin/bash # usage: bash <(curl -SsL https://raw.github.com/smenzer/terminal/master/setup.sh) -# get user inputs +repo="git@bitbucket.org: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 git@github.com:smenzer/terminal.git" -git clone git@github.com: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} \ No newline at end of file diff --git a/uninstall.sh b/uninstall.sh index d93a8fd..6b3208e 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -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} \ No newline at end of file