mirror of
https://github.com/davegallant/nix-config
synced 2026-03-03 16:46:34 +00:00
17 lines
280 B
Bash
Executable File
17 lines
280 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
readarray -t directories < ~/.config/cd-fzf
|
|
|
|
if [[ $# -eq 1 ]]; then
|
|
selected=$1
|
|
else
|
|
selected=$(find "${directories[@]}" -mindepth 1 -maxdepth 1 -type d | fzf --exact)
|
|
fi
|
|
if [[ -z $selected ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo "$selected"
|