Compare commits
3 Commits
83b24c67d1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c1293b1914 | |||
| 512e535ff5 | |||
| 42b97f8ac9 |
@@ -246,6 +246,8 @@ _autoenv_enter() {
|
|||||||
(( ${+_autoenv_entered[${_autoenv_entered[(i)$entered]}]} )) && return
|
(( ${+_autoenv_entered[${_autoenv_entered[(i)$entered]}]} )) && return
|
||||||
# If the enter script is not authorized, return.
|
# If the enter script is not authorized, return.
|
||||||
_autoenv_authorized $entered/.enter || return
|
_autoenv_authorized $entered/.enter || return
|
||||||
|
# Clear positional parameters so they don't leak into the sourced script.
|
||||||
|
set --
|
||||||
# Source the enter script.
|
# Source the enter script.
|
||||||
source $entered/.enter
|
source $entered/.enter
|
||||||
# Add the entered directory to the global entered array.
|
# Add the entered directory to the global entered array.
|
||||||
@@ -258,6 +260,8 @@ _autoenv_exit() {
|
|||||||
local entered=$1
|
local entered=$1
|
||||||
# If the exit script is not authorized, return.
|
# If the exit script is not authorized, return.
|
||||||
_autoenv_authorized $entered/.exit || return
|
_autoenv_authorized $entered/.exit || return
|
||||||
|
# Clear positional parameters so they don't leak into the sourced script.
|
||||||
|
set --
|
||||||
# Source the exit script.
|
# Source the exit script.
|
||||||
source $entered/.exit
|
source $entered/.exit
|
||||||
# Remove the entered directory from the global entered array.
|
# Remove the entered directory from the global entered array.
|
||||||
|
|||||||
@@ -142,6 +142,16 @@ elif which batcat &> /dev/null; then
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Wrap watch to colorize 'watch git status', otherwise pass through to the real
|
||||||
|
# watch command.
|
||||||
|
watch() {
|
||||||
|
if [ "git status" = "$*" ]; then
|
||||||
|
command watch --color -n 2 'git -c color.status=always status'
|
||||||
|
else
|
||||||
|
command watch "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if which docker-machine &> /dev/null; then
|
if which docker-machine &> /dev/null; then
|
||||||
# Wrap the docker command to print a message if a docker-machine is not
|
# Wrap the docker command to print a message if a docker-machine is not
|
||||||
# running, rather than just stating it can not find it's socket.
|
# running, rather than just stating it can not find it's socket.
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ Manage git worktrees by branch name."
|
|||||||
_autoenv_authorized $wt_dest/.enter yes
|
_autoenv_authorized $wt_dest/.enter yes
|
||||||
_autoenv_authorized $wt_dest/.exit yes
|
_autoenv_authorized $wt_dest/.exit yes
|
||||||
fi
|
fi
|
||||||
|
if [ -f $root/local.bazelrc ]; then
|
||||||
|
cp $root/local.bazelrc $wt_dest/local.bazelrc
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cd)
|
cd)
|
||||||
@@ -170,6 +173,15 @@ Manage git worktrees by branch name."
|
|||||||
_autoenv_authorized "$wt_path/$f" yes
|
_autoenv_authorized "$wt_path/$f" yes
|
||||||
print -P "%F{green}updated:%f $wt_path/$f"
|
print -P "%F{green}updated:%f $wt_path/$f"
|
||||||
done
|
done
|
||||||
|
if [[ -f "$root/local.bazelrc" ]]; then
|
||||||
|
if [[ -L "$wt_path/local.bazelrc" ]]; then
|
||||||
|
rm "$wt_path/local.bazelrc"
|
||||||
|
elif [[ -f "$wt_path/local.bazelrc" ]] && cmp -s "$root/local.bazelrc" "$wt_path/local.bazelrc"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
cp "$root/local.bazelrc" "$wt_path/local.bazelrc"
|
||||||
|
print -P "%F{green}updated:%f $wt_path/local.bazelrc"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
return $failed
|
return $failed
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user