AutoYADM commit: 2025-04-22 14:00:12

This commit is contained in:
Daniel Fichtinger 2025-04-22 14:00:13 -04:00
parent 388affce48
commit 93f3562923

View file

@ -21,6 +21,7 @@ set -l src (path resolve $argv[1])
# echo $src # echo $src
# string replace # string replace
set -l targ (string replace --filter '.typ' '.pdf' $src) set -l targ (string replace --filter '.typ' '.pdf' $src)
set -l base (path basename --no-extension $src).pdf
if test -f "$targ" -a '' != '' if test -f "$targ" -a '' != ''
# zathura "$targ" &>/dev/null & # zathura "$targ" &>/dev/null &
z "$targ" z "$targ"
@ -30,18 +31,17 @@ else
# if we're not, search from cwd # if we're not, search from cwd
if git rev-parse --is-inside-work-tree &>/dev/null if git rev-parse --is-inside-work-tree &>/dev/null
# echo in git # echo in git
set -l root (git rev-parse --show-toplevel) set root (git rev-parse --show-toplevel)
# echo $root # echo $root
set -l base (path basename --no-extension $src).pdf
if not find_pdf "$root" "$base"
if set -q _flag_q
return 1
else
echo "$base couldn't be found!"
end
end
else else
echo out git echo out git
set -l root (pwd) set root (pwd)
end
if not find_pdf "$root" "$base"
if set -q _flag_q
return 1
else
echo "$base couldn't be found!"
end
end end
end end