fix: typstyle #120

Merged
servostar merged 4 commits from fix/typstyle into main 2024-12-03 08:29:34 +00:00
1 changed files with 11 additions and 1 deletions
Showing only changes of commit 4573e87344 - Show all commits

View File

@ -17,7 +17,7 @@ function format() {
exit 1
fi
local imports=$(rg "#import \"([a-z0-9/\-]+\.typ)\"" -Nor '$1' "$1")
local imports=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1")
# format all included files
while IFS= read -r line; do
@ -26,6 +26,16 @@ function format() {
fi
format "$wd/$line" "$2"
done <<< "$imports"
local includes=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1")
# format all included files
while IFS= read -r line; do
if [ -z "$line" ]; then
continue
fi
format "$wd/$line" "$2"
done <<< "$includes"
}
case $1 in