some tweaks
Added the _ to $DOTFILES to prevent it from appearing first in tab-completion
This commit is contained in:
parent
a36c5ad81d
commit
3f71537d9d
@ -11,25 +11,26 @@ function _update_dotfiles_update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _upgrade_dotfiles() {
|
function _upgrade_dotfiles() {
|
||||||
env DOTFILES=$DOTFILES sh $DOTFILES/upgrade.sh
|
env _DOTFILES=$_DOTFILES sh $_DOTFILES/upgrade.sh
|
||||||
# update the zsh file
|
# 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
|
if [[ -z "$epoch_target" ]]; then
|
||||||
# Default to old behavior
|
# Default to every 2 weeks
|
||||||
epoch_target=13
|
epoch_target=13
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cancel upgrade if the current user doesn't have write permissions for the
|
# Cancel upgrade if the current user doesn't have write permissions for the
|
||||||
# dotfiles directory.
|
# 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
|
# 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
|
if [ -f ~/.dotfiles-update ]; then
|
||||||
. ~/.dotfiles-update
|
. ~/.dotfiles-update
|
||||||
|
|
||||||
@ -56,5 +57,5 @@ if mkdir "$DOTFILES/log/update.lock" 2>/dev/null; then
|
|||||||
_update_dotfiles_update
|
_update_dotfiles_update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rmdir $DOTFILES/log/update.lock
|
rmdir $_DOTFILES/log/update.lock
|
||||||
fi
|
fi
|
||||||
|
@ -6,14 +6,18 @@ export LC_ALL=en_US.UTF-8
|
|||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
export LANGUAGE=en_US.UTF-8
|
export LANGUAGE=en_US.UTF-8
|
||||||
|
|
||||||
export DOTFILES="${HOME}/dotfiles"
|
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
export PATH=$PATH:${HOME}/bin:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/bin
|
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
|
# Allow automatic updates
|
||||||
export DISABLE_DOTFILES_AUTO_UPDATE="FALSE"
|
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
|
# Automatically attach tmux session "C0DE" upon entering a shell
|
||||||
if [[ -z "$TMUX" ]]; then
|
if [[ -z "$TMUX" ]]; then
|
||||||
tmux attach -t C0DE || tmux new -s C0DE
|
tmux attach -t C0DE || tmux new -s C0DE
|
||||||
|
@ -21,7 +21,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
printf "${BLUE}%s${NORMAL}\n" "Updating your dotfiles"
|
printf "${BLUE}%s${NORMAL}\n" "Updating your dotfiles"
|
||||||
cd "$DOTFILES"
|
cd "$_DOTFILES"
|
||||||
branch=$(git name-rev --name-only HEAD)
|
branch=$(git name-rev --name-only HEAD)
|
||||||
if git pull --rebase --stat origin $branch
|
if git pull --rebase --stat origin $branch
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user