AutoYADM commit: 2025-04-22 14:00:12
This commit is contained in:
parent
388affce48
commit
93f3562923
1 changed files with 10 additions and 10 deletions
|
@ -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,9 +31,12 @@ 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
|
else
|
||||||
|
echo out git
|
||||||
|
set root (pwd)
|
||||||
|
end
|
||||||
if not find_pdf "$root" "$base"
|
if not find_pdf "$root" "$base"
|
||||||
if set -q _flag_q
|
if set -q _flag_q
|
||||||
return 1
|
return 1
|
||||||
|
@ -40,8 +44,4 @@ else
|
||||||
echo "$base couldn't be found!"
|
echo "$base couldn't be found!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
echo out git
|
|
||||||
set -l root (pwd)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue