organic/org_mode_samples/dump_org_ast.bash

18 lines
351 B
Bash
Executable File

#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INPUT_FILE="$1"
OUTPUT_FILE="$2"
INIT_SCRIPT=$(cat <<EOF
(progn
(org-mode)
(org-dump-ast "$OUTPUT_FILE")
)
EOF
)
exec emacs -q --no-site-file --no-splash --batch --load "$DIR/common.el" --insert "$INPUT_FILE" --eval "$INIT_SCRIPT"