AutoYADM commit: 2025-04-22 13:45:12
This commit is contained in:
parent
51ef9ae469
commit
e3c89f1c37
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,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)
|
||||||
if test -f "$targ"
|
if test -f "$targ" -a '' != ''
|
||||||
zathura "$targ" &>/dev/null &
|
zathura "$targ" &>/dev/null &
|
||||||
else
|
else
|
||||||
# no such file in current dir, time to search!
|
# no such file in current dir, time to search!
|
||||||
|
@ -12,7 +12,13 @@ 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)
|
||||||
|
echo $root
|
||||||
|
set -l base (path basename --no-extension)
|
||||||
|
set -l base $base.pdf
|
||||||
|
echo $base
|
||||||
else
|
else
|
||||||
echo out git
|
echo out git
|
||||||
|
set -l root (pwd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue