diff options
-rwxr-xr-x | src/conf | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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 \ |