Created
July 14, 2020 07:06
-
-
Save Wabri/5f850fd0fd5e1649e4e2da9c10e58434 to your computer and use it in GitHub Desktop.
One compiler to rule them all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
file=$(readlink -f "$1") | |
dir=$(dirname "$file") | |
base="${file%.*}" | |
cd "$dir" || exit | |
case "$file" in | |
*\.tex) pandoc "$file" -f latex -s -o "$base".pdf ;; | |
*\.md) pandoc "$file" -f markdown -s -o "$base".pdf ;; | |
*\.py) python "$file" ;; | |
*\.c) clang $file ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment