summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-07-30 01:20:04 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-07-30 01:20:04 -0400
commit62418185b148dbd475728358a137d24bd392f4b0 (patch)
tree8a146332d9cf9af82b4ed8112ec843f5354518c3
parente4a64f6527936e85541f52a34384d15f70ea9872 (diff)
downloadeibhear-62418185b148dbd475728358a137d24bd392f4b0.tar.gz
eibhear-62418185b148dbd475728358a137d24bd392f4b0.tar.zst
eibhear-62418185b148dbd475728358a137d24bd392f4b0.zip
compile script compiles from directory of file
-rwxr-xr-x.scripts/compiler4
1 files changed, 4 insertions, 0 deletions
diff --git a/.scripts/compiler b/.scripts/compiler
index 73ce5bc..919b428 100755
--- a/.scripts/compiler
+++ b/.scripts/compiler
@@ -9,9 +9,12 @@
# config.h files: (For suckless utils) recompiles and installs program.
# all others: run `sent` to show a presentation
+oridir=$(pwd)
+
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
+cd $dir
textype() { \
command="pdflatex"
@@ -30,3 +33,4 @@ case "$file" in
*config.h) make && sudo make install ;;
*) sent "$file" 2>/dev/null & ;;
esac
+cd $oridir