-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sh
executable file
·69 lines (52 loc) · 1.53 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
#
# Copyright (C) 2014- 2018 Zafar Khaydarov
#
# What it does:
# -- builds pdf output and stores version of the output in the ARC directory
# -- clean-up of tmp files
# -- makes copy of the output pdf file in ARC dir.
# -- commits current version into git
#
# How to use:
# Just launch the file in bash
#
hash pdflatex 2>/dev/null || { echo >&2 "No pdflatex has been found. Aborting. If you use brew install using: 'brew cask install mactex'"; exit 1; }
cur_day=$(date +_%b_%Y)
todays_date=$(date +%F)
resume_file='resume-template.tex'
pdf_out='resume-template.pdf'
mylocation='NYC'
existing_file="FirstName_LastName_SDE_Resume_$mylocation"_$cur_day".pdf"
if [ -f "${existing_file}" ]
then
echo "${existing_file} "
if [ ! -d "ARC" ]
then
mkdir ARC/tex
fi
mv ${existing_file} ARC/
if ls *pdf 1> /dev/null 2>&1; then
mv *pdf ARC/
fi
fi
echo "Compiling.."
pdflatex "${resume_file}" >> /dev/null;
pdflatex "${resume_file}" >> /dev/null;
pdflatex "${resume_file}" >> /dev/null;
pdflatex preparationGrid.tex >> /dev/null;
clear
echo "---------------------------------------"
echo "Compiled with exit code -> " $?
echo "Final output" ${existing_file}
# rename
mv -f "${pdf_out}" ${existing_file}
echo -e "Cleaning up..";
rm -rf *aux *bbl *log *out *blg
echo "Done";
open ${existing_file}
open preparationGrid.pdf
# including in VCS
# echo -e "Please version the revision -- Enter commit message for revision \n\n"
# read -n1 -r -p "Press any key to continue..." key
# git commit