summaryrefslogtreecommitdiff
path: root/src/conf
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf')
-rwxr-xr-xsrc/conf15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conf b/src/conf
index fa753e9..b423e23 100755
--- a/src/conf
+++ b/src/conf
@@ -92,13 +92,14 @@ eval "$(assert-arg -- "$FILENAME" 'FILENAME')"
trap 'rm -f -- "$FILENAME".embedded-config' EXIT
-{
- if head -n1 -- "$FILENAME" | grep -q '^////$'; then
- awk 'sep > 1 {exit}; /^\/{4}$/ { sep++; next } { print }' \
- "$FILENAME"
- fi
-} > "$FILENAME".embedded-config
-. "$(realpath -- "$FILENAME".embedded-config)"
+awk '
+$0 == "" {exit}
+/^= / {next}
+{ printf "export %s=\"%s\"\n",
+ substr($1, 2, length($1) - 2),
+ substr($0, length($1) + 2) }
+' "$FILENAME" > "$FILENAME".embedded-config
+. ./"$FILENAME".embedded-config
is_article() {
printf '%s\n' "$FILENAME" | grep -qE \