commit 53fe5c5b6292ba454fdf8172699275dc61e4e385 parent 94da83981d0736b407eba62e2962520f96eb65cc author: nathanael <nathanael@dalliard.ch> date: Fri, 17 Oct 2025 18:04:18 +0000 update bin fopen diffstat:
| M | s0/dotfiles/bin/fopen | | | 13 | +++++++------ |
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/s0/dotfiles/bin/fopen b/s0/dotfiles/bin/fopen @@ -1,10 +1,11 @@ #!/bin/sh -file=$(find . \( \ - -path './.*' -o \ - -name 'src' \ -\) -prune -o -type f -print | fzy) +[ $# -eq 0 ] && { + file=$(find . \( \ + -path './.*' -o \ + -name 'src' \ + \) -prune -o -type f -print | fzy) +} || file=$1 [ -n "$file" ] && { - path=$(readlink -f "$file") - echo "$path" > /tmp/filepath.txt + readlink -f "$file" > /tmp/filepath.txt open "$file" || ${EDITOR:-vi} "$file" }