Skip to content

Commit 20dae07

Browse files
committed
Move cdgroot to functions lib
1 parent faccbd1 commit 20dae07

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

home/dot_aliases.tmpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@ alias git-prune-all="git fetch --all && git remote prune origin && git branch -v
88
new-branch() {
99
git checkout -b "{{ .gitBranchPrefix }}$1"
1010
}
11-
12-
cdgroot() {
13-
local dir="$(git rev-parse --show-toplevel)"
14-
[[ -n "$dir" ]] && cd "$dir"
15-
}

home/lib/common/functions.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ has_cmd() {
2828
todo() {
2929
eval $EDITOR "$HOME/Documents/todo.md"
3030
}
31+
32+
cdgroot() {
33+
local dir="$(git rev-parse --show-toplevel)"
34+
[[ -n "$dir" ]] && cd "$dir"
35+
}

0 commit comments

Comments
 (0)