1
Fork 0

Read output file path from environment

This commit is contained in:
Jake Howard 2018-04-25 09:54:31 +01:00
parent e9f000473f
commit 88130a1fa0
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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,