some tweaks

Added the _ to $DOTFILES to prevent it from appearing first in tab-completion
This commit is contained in:
David Todd (c0de) 2018-02-10 22:24:17 -06:00
parent a36c5ad81d
commit 3f71537d9d
3 changed files with 16 additions and 11 deletions

View File

@ -11,25 +11,26 @@ function _update_dotfiles_update() {
}
function _upgrade_dotfiles() {
env DOTFILES=$DOTFILES sh $DOTFILES/upgrade.sh
env _DOTFILES=$_DOTFILES sh $_DOTFILES/upgrade.sh
# update the zsh file
_update_zsh_update
_update_dotfiles_update
}
epoch_target=$UPDATE_ZSH_DAYS
# Configure this in shell/env
epoch_target=$UPDATE_DOTFILES_DAYS
if [[ -z "$epoch_target" ]]; then
# Default to old behavior
# Default to every 2 weeks
epoch_target=13
fi
# Cancel upgrade if the current user doesn't have write permissions for the
# dotfiles directory.
[[ -w "$DOTFILES" ]] || return 0
[[ -w "$_DOTFILES" ]] || echo "You can't write to $(dotfiles)"; return 1
# Cancel upgrade if git is unavailable on the system
whence git >/dev/null || return 0
whence git >/dev/null || echo "git is not available"; return 2
if mkdir "$DOTFILES/log/update.lock" 2>/dev/null; then
if mkdir "$_DOTFILES/log/update.lock" 2>/dev/null; then
if [ -f ~/.dotfiles-update ]; then
. ~/.dotfiles-update
@ -56,5 +57,5 @@ if mkdir "$DOTFILES/log/update.lock" 2>/dev/null; then
_update_dotfiles_update
fi
rmdir $DOTFILES/log/update.lock
rmdir $_DOTFILES/log/update.lock
fi

View File

@ -6,14 +6,18 @@ 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
# Give the path to the dotfiles
export _DOTFILES="${HOME}/dotfiles"
# Allow automatic updates
export DISABLE_DOTFILES_AUTO_UPDATE="FALSE"
# Update every 2 weeks (OMZ default)
export UPDATE_DOTFILES_DAYS=13
# Automatically attach tmux session "C0DE" upon entering a shell
if [[ -z "$TMUX" ]]; then
tmux attach -t C0DE || tmux new -s C0DE

View File

@ -21,7 +21,7 @@ else
fi
printf "${BLUE}%s${NORMAL}\n" "Updating your dotfiles"
cd "$DOTFILES"
cd "$_DOTFILES"
branch=$(git name-rev --name-only HEAD)
if git pull --rebase --stat origin $branch
then