Skip to content

Instantly share code, notes, and snippets.

@cotocisternas
Last active November 10, 2017 12:18
Show Gist options
  • Select an option

  • Save cotocisternas/f01a9cdcb8a5866acd7b96f6ecc08b25 to your computer and use it in GitHub Desktop.

Select an option

Save cotocisternas/f01a9cdcb8a5866acd7b96f6ecc08b25 to your computer and use it in GitHub Desktop.
install() {
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
set -e
if [ ! -n "$VINCENT_SETUP" ]; then
VINCENT_SETUP=~/.setup
fi
umask g-w,o-w
printf "${BLUE}Cloning setup...${NORMAL}\n"
hash git >/dev/null 2>&1 || {
echo "Error: git is not installed"
exit 1
}
rm -Rf $VINCENT_SETUP
env git clone --depth=1 git@github.com:cotocisternas/setup.git $VINCENT_SETUP || {
printf "Error: git clone of vincent-setup repo failed\n"
exit 1
}
printf "${BLUE}Creating ~/.vincentrc${NORMAL}\n"
cp $VINCENT_SETUP/config/vincentrc.zsh-template ~/.vincentrc
printf "${GREEN}Finish Setup ENV\n"
printf "${GREEN}Starting Setup\n"
chmod a+x $VINCENT_SETUP/tools/setup.sh
env sh $VINCENT_SETUP/tools/setup.sh
printf "${NORMAL}"
}
install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment