From 3abd3c83abe52b0c985ffbabbbbb36c8a7cb4ffc Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 14 Apr 2022 16:24:00 -0700 Subject: [PATCH] Revert "pandoc-make: add PANDOC_DEFAULT_ARGS array" This reverts commit 19ca438748cf2867230527b174ea6d81ebb8bb22. --- .config/shell/bin/pandoc-make | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/shell/bin/pandoc-make b/.config/shell/bin/pandoc-make index f517a27..c77adb9 100755 --- a/.config/shell/bin/pandoc-make +++ b/.config/shell/bin/pandoc-make @@ -14,10 +14,9 @@ usage() { $0 .docx *.md # leading .'s are automatically removed from the output format Note: - 1) To put a file in pandoc arguments without having it be compiled to its own document, put a './' or '../' at the start of the path to it - - You can have as many arg/file combinations you want - - The argument array is cleared between input files - 2) You can set default arguments in the array PANDOC_DEFAULT_ARGS and export them for this script to use + To put a file in pandoc arguments without having it be compiled to its own document, put a './' at the start of the path to it + You can have as many arg/file combinations you want + The argument array is cleared between input files EOF } @@ -39,8 +38,7 @@ SKIP_FIRST=true # don't process the first argument, it is the output format for FILE in "$@";do $SKIP_FIRST && SKIP_FIRST=false && continue - PANDOC_ARGS="${PANDOC_DEFAULT_ARGS[*]:-"$PANDOC_ARGS"}" - if [[ -f "$FILE" ]] && { [[ "${FILE:0:2}" != "./" ]] || [[ "${FILE:0:3}" != "../" ]]; }; then + if [[ -f "$FILE" ]] && [[ "${FILE:0:2}" != "./" ]]; then pandoc -s "$FILE" "${PANDOC_ARGS[@]}" -o "${FILE%.*}.${OUTPUT_FORMAT##.}" PANDOC_ARGS=() else