From 88130a1fa0cd625021e86232d91cb5168b78839a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 25 Apr 2018 09:54:31 +0100 Subject: [PATCH] Read output file path from environment --- build.sh | 2 +- word-count.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 0dbc460..79a7532 100755 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ ADDITIONAL_ARGS=${@:2} INPUT_FILE=`realpath $1` INPUT_DIR=`dirname $INPUT_FILE` METADATA_FILE="$INPUT_DIR/metadata.yaml" -OUTPUT_FILE="$INPUT_DIR/output.pdf" +export OUTPUT_FILE="$INPUT_DIR/output.pdf" INPUT_FILES="$INPUT_FILE" diff --git a/word-count.lua b/word-count.lua index 3606331..3b577d5 100644 --- a/word-count.lua +++ b/word-count.lua @@ -1,7 +1,7 @@ return { { Meta = function(meta) - local rawText = pandoc.pipe("pdftotext", {"output.pdf", "-"}, "") + local rawText = pandoc.pipe("pdftotext", {os.getenv("OUTPUT_FILE"), "-"}, "") meta["wordcount"] = pandoc.pipe("wc", {"-w"}, rawText) return meta end,