~seirdy/dotfiles

9b81826e82bee873e9d0f8b522b2e27900b69cb4 — Rohan Kumar 8 months ago 9c53691
Replace a script with a function

Because it has to actually change my working directory
2 files changed, 11 insertions(+), 12 deletions(-)

M .config/shell_common/functions.sh
D Executables/shell-scripts/bin/cdg
M .config/shell_common/functions.sh => .config/shell_common/functions.sh +11 -0
@@ 17,6 17,17 @@ wdir() {
	cd "$progdir" || return
}

cdg() {
	# cd to a git repo managed by ghq
	if [ -z "$1" ]; then
		cdto=$(ghq list | fzf)
	else
		cdto=$(ghq list | fzf -q "$@")
	fi
	# shellcheck disable=SC2154
	[ "$cdto" = '' ] || cd "$GHQ_ROOT/$cdto" || return 1
}

history_stats() {
	if [ -z "$1" ]; then
		entries=1000

D Executables/shell-scripts/bin/cdg => Executables/shell-scripts/bin/cdg +0 -12
@@ 1,12 0,0 @@
#!/usr/bin/env dash
# cd to a git repo managed by ghq
if [ -z "$1" ]; then
	cdto=$(ghq list | fzf)
else
	cdto=$(ghq list | fzf -q "$@")
fi
# shellcheck disable=SC2154
[ "$cdto" = '' ] || cd "$GHQ_ROOT/$cdto" || return 1

# vi:ft=sh