Skip to content

Commit

Permalink
Simplify dot command
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezcasas committed Dec 6, 2020
1 parent a4263e3 commit c6ebd3b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/dot
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ fi
fzf_prompt() {
local paths="$1"

script="$(echo "$paths" |
xargs -I % sh -c 'echo "$(basename $(dirname %)) $(basename %)"' |
fzf --height 100% --preview '"$DOTLY_PATH/bin/dot" $(echo {} | cut -d" " -f 1) $(echo {} | cut -d" " -f 2) -h')"
script="$(
echo "$paths" |
xargs -I % sh -c 'echo "$(basename $(dirname %)) $(basename %)"' |
fzf \
--height 100% \
--preview '"$DOTLY_PATH/bin/dot" $(echo {} | cut -d" " -f 1) $(echo {} | cut -d" " -f 2) -h'
)"

printf "%s" "$script"
read -r args
Expand Down

0 comments on commit c6ebd3b

Please sign in to comment.