cds: cds no longer takes fd arguments, and instead takes just a search

term
This commit is contained in:
PowerUser64 2022-04-01 11:47:47 -07:00
parent 30c500d54b
commit a0cdccfa06

View file

@ -3,10 +3,10 @@
# cd search: cd to a directory, given part of its name # cd search: cd to a directory, given part of its name
# Requires: fd, fzf # Requires: fd, fzf
# Usage: takes `fd` arguments # Usage: cds "Search Term"
cds() { cds() {
DIR="$(fd -t d $@ | fzf -1 -q "$SEARCH_TERM" --layout=reverse --info=inline --height=10%)" DIR="$(fd -t d | fzf -1 -q "$1" --layout=reverse --info=inline --height=10%)"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if [ -f "$DIR" ]; then if [ -f "$DIR" ]; then
cd "$(dirname "$DIR")" && pwd cd "$(dirname "$DIR")" && pwd