Loading .bashrc +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ fi . ~/.shell/funcs do_update # Source global definitions # (debian global bashrc has a bad habit of setting PS1, so store and revert # after) Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ # flags, timestamps /.sudo_as_admin_successful /.zsh-update /.shell/.update # other version control systems .svn/ Loading .shell/funcs +27 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,30 @@ manage_path() done eval $var="'${pre:+$pre:}$val${post:+:$post}'" } do_update() { local timestamp=${HOME}/.shell/.update local now=`date +%s` updated=`date -r $timestamp +%s 2>/dev/null` local BOLD_BLUE=$'\033[34;1m' DEFAULT=$'\033[m' local prompt="${BOLD_BLUE}Would you like to update dotfiles?${DEFAULT} " if [ $now -lt $((updated + 604800)) ]; then return fi touch "$timestamp" case $0 in *zsh) read "?$prompt" ans ;; *) read -p "$prompt" ans ;; esac case "$ans" in [Yy]|[Yy][Ee][Ss]) ;; *) return ;; esac cd ~ git pull origin --ff-only cd - >/dev/null } .zshrc +2 −0 Original line number Diff line number Diff line source ~/.shell/funcs do_update plugins+=(git django pip python) plugins+=(virtualenv virtualenvwrapper tmux-virtualenvwrapper) Loading Loading
.bashrc +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ fi . ~/.shell/funcs do_update # Source global definitions # (debian global bashrc has a bad habit of setting PS1, so store and revert # after) Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ # flags, timestamps /.sudo_as_admin_successful /.zsh-update /.shell/.update # other version control systems .svn/ Loading
.shell/funcs +27 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,30 @@ manage_path() done eval $var="'${pre:+$pre:}$val${post:+:$post}'" } do_update() { local timestamp=${HOME}/.shell/.update local now=`date +%s` updated=`date -r $timestamp +%s 2>/dev/null` local BOLD_BLUE=$'\033[34;1m' DEFAULT=$'\033[m' local prompt="${BOLD_BLUE}Would you like to update dotfiles?${DEFAULT} " if [ $now -lt $((updated + 604800)) ]; then return fi touch "$timestamp" case $0 in *zsh) read "?$prompt" ans ;; *) read -p "$prompt" ans ;; esac case "$ans" in [Yy]|[Yy][Ee][Ss]) ;; *) return ;; esac cd ~ git pull origin --ff-only cd - >/dev/null }
.zshrc +2 −0 Original line number Diff line number Diff line source ~/.shell/funcs do_update plugins+=(git django pip python) plugins+=(virtualenv virtualenvwrapper tmux-virtualenvwrapper) Loading