aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-05-29 02:48:25 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-05-29 02:48:25 +0100
commit62b8983f25805829cdd02fbc3204cd7676a3e6fc (patch)
tree56f20af5bd9fdf71a754aff44b6afc609fae5a7b /project
parent59212b82ef374da6374b7d7e8d0367675c58d5aa (diff)
pdftotext only called if present in system, minor edit
David and Raul had both reported that because 'pdftotext' wasn't available on their system, the project failed (even though the PDF was built!). So with this commit, we first check if the system has 'pdftotext' and call it only if its is available. Some minor edits were made, building upon Boud's previous commit.
Diffstat (limited to 'project')
-rwxr-xr-xproject10
1 files changed, 6 insertions, 4 deletions
diff --git a/project b/project
index 47cb5ae..1d7847a 100755
--- a/project
+++ b/project
@@ -407,10 +407,12 @@ EOF
# Run the actual project.
controlled_env reproduce/analysis/make/top-make.mk
- # Print the number of words
- numwords=$(/usr/bin/pdftotext paper.pdf && cat paper.txt | wc -w)
- echo; echo "Number of words in full PDF: $numwords"
- rm paper.txt
+ # Print the number of words (if the user has pdftotext.
+ if which pdftotext &> /dev/null; then
+ numwords=$(pdftotext paper.pdf && cat paper.txt | wc -w)
+ echo; echo "Number of words in full PDF: $numwords"
+ rm paper.txt
+ fi
;;