Automatic updates

By default, this should prompt to update once every 14 days.
If user answers anything other than y/Y, wait until next cycle
If user answers y/Y, pull down the current branch's dotfiles
(ensure that your machine is on the correct branch if you have multiple)
This commit is contained in:
David Todd (c0de)
2018-02-10 21:36:07 -06:00
parent 46f08706bf
commit 81301e3ccc
5 changed files with 110 additions and 1 deletions

View File

@@ -6,9 +6,14 @@ export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export DOTFILES = "${HOME}/dotfiles"
# Paths
export PATH=$PATH:${HOME}/bin:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/bin
# Allow automatic updates
DISABLE_DOTFILES_AUTO_UPDATE = "FALSE"
# Automatically attach tmux session "C0DE" upon entering a shell
if [[ -z "$TMUX" ]]; then
tmux attach -t C0DE || tmux new -s C0DE

View File

@@ -20,7 +20,7 @@ extract () { # Extracts most common compressed files
fi
}
# Takes 1st argument and makes a .tar.gz archive
maketar() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
maketgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
# Takes 1st argument and makes a .zip archive
makezip() { zip -r "${1%%/}.zip" "$1" ; }
# Generate password - 1st argument is the number of characters, defaults to 20

View File

@@ -39,6 +39,12 @@ function insert_sudo {
zle -N insert-sudo insert_sudo
bindkey "^[s" insert-sudo
# Check for updates...
# Stolen and modified Oh-My-ZSH's update system
if [ "$DISABLE_DOTFILES_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH DOTFILES=$DOTFILES DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $DOTFILES/check_for_upgrade.sh
fi
# Oh-My-ZSH Options below this line
# Define Oh-My-ZSH root
@@ -64,6 +70,7 @@ COMPLETION_WAITING_DOTS="true"
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git \
per-directory-history \
virtualenvwrapper \
wp-cli \
nyan)