Skip to content

Instantly share code, notes, and snippets.

@filviu
Last active November 26, 2015 10:19
Show Gist options
  • Save filviu/219034b94be99ec38fb2 to your computer and use it in GitHub Desktop.
Save filviu/219034b94be99ec38fb2 to your computer and use it in GitHub Desktop.
Deploy my homeshick based dotfiles

How to run

curl -s https://gist.githubusercontent.com/silviuvulcan/219034b94be99ec38fb2/raw/hsdeploy.sh | bash
#!/bin/bash
LV="$1"
distros=( el6 el7 )
LOG="$HOME/deploy.log"
if type tput >/dev/null 2>&1; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
COLRESET=$(tput sgr0)
COLOR=1
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
WHITE=""
BRIGHT=""
COLRESET=""
COLOR=0
fi
function try_run {
MSG="$1... "
printf "$MSG"
echo >> "$LOG"
echo -n "$(date '+%Y %b %d %H:%M:%S') " >> "$LOG"
echo "${@:2}" >> "$LOG"
if [ $COLOR -eq 1 ]; then
let COL=$(tput cols)-${#MSG}+${#YELLOW}+${#COLRESET}
else
let COL=80-${#MSG}
fi
"${@:2}" >> "$LOG" 2>&1
if [ $? -eq 0 ]; then
printf "%${COL}s" "[$YELLOW OK $COLRESET] "
else
printf "%${COL}s" "[$RED Failed $COLRESET] "
fi
# ensure new line even on badly calculated lines
echo
}
echo
echo -e "${BLUE}Installig homeshick and other non-distro specific items${COLRESET}"
echo -e "${BLUE}-------------------------------------------------------${COLRESET}"
echo
try_run "Installing homeshick" git clone https://github.com/andsens/homeshick.git $HOME/.homesick/repos/homeshick
try_run "Sourcing homeshick" source "$HOME/.homesick/repos/homeshick/homeshick.sh"
try_run "homeshick is installing Vundle" homeshick -b clone gmarik/Vundle
try_run "homeshick is installing silviuvulcan/dotfiles" homeshick -b clone silviuvulcan/dotfiles
try_run "homeshick is symlinking" homeshick -f link
try_run "Installing vim bundle" vim -E -u NONE -S ~/.vimrc.vundle +PluginInstall +qall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment