Augments functions to achieve more expected behavior

This commit is contained in:
William Carroll 2016-08-02 16:12:59 -04:00
parent b28331b896
commit 6021ad3194
2 changed files with 9 additions and 2 deletions

View file

@ -51,7 +51,7 @@ function wgcheckout {
# wgcheckout combined with a fuzzy search
function wgfcheckout {
branchname=$(git branch | fzf)
branchname=$(trim $(git branch | fzf))
[ ! -z "$branchname" ] && wgcheckout "$branchname" || return
}

View file

@ -22,7 +22,14 @@ function wfd {
# pushd into a directory on your dirs stack
function wpushd {
dir=$(dirs | tr ' ' '\n' | fzf | dirname) && pushd "$dir"
dir="$(dirs | tr ' ' '\n' | fzf)" && pushd "$dir"
}
# trims leading and trailing whitespace
function trim {
input="$1"
echo "${input//[[:blank:]]/}"
}