Skip to content

Commit

Permalink
Update cmd.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Mar 6, 2025
1 parent 1afcac9 commit cec80c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/coverpage/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ fi

NODE_JSON_URL="$1"
TMP_DIR=$(mktemp -d)

cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT

EXISTING_PDF="$TMP_DIR/existing.pdf"
cat > "${EXISTING_PDF}"

Expand Down Expand Up @@ -62,5 +68,3 @@ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="${MERGED_PDF}" "$PDF_FIL

cat "$MERGED_PDF"

# Cleanup
rm -r "$TMP_DIR" || echo "Could not cleanup temporary files"

0 comments on commit cec80c4

Please sign in to comment.