Read output file path from environment
This commit is contained in:
parent
e9f000473f
commit
88130a1fa0
2 changed files with 2 additions and 2 deletions
2
build.sh
2
build.sh
|
@ -8,7 +8,7 @@ ADDITIONAL_ARGS=${@:2}
|
||||||
INPUT_FILE=`realpath $1`
|
INPUT_FILE=`realpath $1`
|
||||||
INPUT_DIR=`dirname $INPUT_FILE`
|
INPUT_DIR=`dirname $INPUT_FILE`
|
||||||
METADATA_FILE="$INPUT_DIR/metadata.yaml"
|
METADATA_FILE="$INPUT_DIR/metadata.yaml"
|
||||||
OUTPUT_FILE="$INPUT_DIR/output.pdf"
|
export OUTPUT_FILE="$INPUT_DIR/output.pdf"
|
||||||
|
|
||||||
INPUT_FILES="$INPUT_FILE"
|
INPUT_FILES="$INPUT_FILE"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
Meta = function(meta)
|
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)
|
meta["wordcount"] = pandoc.pipe("wc", {"-w"}, rawText)
|
||||||
return meta
|
return meta
|
||||||
end,
|
end,
|
||||||
|
|
Reference in a new issue