diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-24 12:22:09 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-24 12:22:09 -0500 |
commit | 2c5a050641d5400843facfc65e58a2bef5d87422 (patch) | |
tree | b9b0f04c256509dc773197c90605f763d51c3400 /.local/bin/compiler | |
parent | 61e7324e6692b155b6dd1d450ff431582c1fc57b (diff) |
Multithreaded R package compilation
Diffstat (limited to '.local/bin/compiler')
-rwxr-xr-x | .local/bin/compiler | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler index 9020284..220b4a9 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -12,30 +12,30 @@ base="${file%.*}" cd "$dir" || exit -textype() { \ - command="pdflatex" - ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" - $command --output-directory="$dir" "$base" && - grep -i addbibresource "$file" >/dev/null && - biber --input-directory "$dir" "$base" && - $command --output-directory="$dir" "$base" && - $command --output-directory="$dir" "$base" - } +textype() { + command="pdflatex" + (sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex" + $command --output-directory="$dir" "$base" && + grep -i addbibresource "$file" >/dev/null && + biber --input-directory "$dir" "$base" && + $command --output-directory="$dir" "$base" && + $command --output-directory="$dir" "$base" +} case "$file" in - *\.ms) refer -PS -e -p"$REFERBIB" "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - *\.gd) groffdown "$file" | refer -PS -e "-p$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - # *\.gd) groffdown "$file" | refer -PS -e "$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - *\.mom) refer -PS -e -p"$REFERBIB" "$file" | groff -mom -kejpt -T pdf > "$base".pdf ;; - *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; - *\.rnw) Rscript -e "knitr::knit2pdf('"$file"')" ;; - *\.tex) textype "$file" ;; - *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; - *config.h) make && sudo make install ;; - *\.c) cc "$file" -o "$base" && "$base" ;; - *\.py) python "$file" ;; - *\.go) go run "$file" ;; - *\.sent) setsid sent "$file" 2>/dev/null & ;; - *.Xresources) xrdb -load "$file" ;; - *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; +*\.ms) refer -PS -e -p"$REFERBIB" "$file" | groff -me -ms -kejpt -T pdf >"$base".pdf ;; +*\.gd) groffdown "$file" | refer -PS -e "-p$REFERBIB" | groff -me -ms -kejpt -T pdf >"$base".pdf ;; +# *\.gd) groffdown "$file" | refer -PS -e "$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; +*\.mom) refer -PS -e -p"$REFERBIB" "$file" | groff -mom -kejpt -T pdf >"$base".pdf ;; +*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; +*\.rnw) Rscript -e "knitr::knit2pdf('""$file""')" ;; +*\.tex) textype "$file" ;; +*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; +*config.h) make && sudo make install ;; +*\.c) cc "$file" -o "$base" && "$base" ;; +*\.py) python "$file" ;; +*\.go) go run "$file" ;; +*\.sent) setsid sent "$file" 2>/dev/null & ;; +*.Xresources) xrdb -load "$file" ;; +*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; esac |