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,