diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index 231e65f5..7beaffbc 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -17,12 +17,14 @@ function find_pdf end end +# only return status 1 if -q not set if set -q _flag_q set ret 1 else set ret 0 end +# only echo if -q not set function qecho if not set -q _flag_q echo $argv[1] @@ -32,7 +34,7 @@ end set -l src (path resolve $argv[1]) # echo $src # string replace -if not string match -q '.typ' $src +if not string match -q '*.typ' $src qecho "$(path basename $src) is not a Typst file!" return $ret end