diff --git a/home/zsh/files/fzgo.zsh b/home/zsh/files/fzgo.zsh index 481cfca..f298710 100644 --- a/home/zsh/files/fzgo.zsh +++ b/home/zsh/files/fzgo.zsh @@ -19,12 +19,11 @@ local function get_entries() { return fi for entry in "$XDG_CONFIG_HOME/fzgo/entries/$file_type"/*; do - # If the file is a symlink to a directory, we want to list the directory if [ -L "$entry" ]; then - target=$(realpath "$entry") - if [ -d "$target" ]; then - fd . "$target" -t "$file_type" - fi + entry=$(realpath "$entry") + end + if [ -d "$entry" ]; then + fd . "$entry" -t "$file_type" else cat "$entry" fi @@ -42,15 +41,14 @@ function fzgo_update_cache() { for entry in "$file_type_dir"/*; do file_type=$(basename "$file_type_dir") mkdir -p "$XDG_CACHE_HOME/fzgo/entries/$file_type" - # If the file is a symlink to a directory, we want to list the directory if [ -L "$entry" ]; then - target=$(realpath "$entry") - if [ -d "$target" ]; then - out_file="$(echo "$target" | sed 's\/\|\g')" - out_file="$XDG_CACHE_HOME/fzgo/entries/$file_type/$out_file" - mkdir -p "$(dirname \"$out_file\")" - fd . "$target" -t "$file_type" > "$out_file" - fi + entry=$(realpath "$entry") + end + if [ -d "$entry" ]; then + out_file="$(echo "$entry" | sed 's\/\|\g')" + out_file="$XDG_CACHE_HOME/fzgo/entries/$file_type/$out_file" + mkdir -p "$(dirname \"$out_file\")" + fd . "$entry" -t "$file_type" > "$out_file" fi done done