Files
i2p.newsxml/create_new_entry.sh
2017-05-02 13:20:40 +00:00

17 lines
479 B
Bash
Executable File

#!/bin/sh
ENTRIES=data/entries.html
UUIDGEN="`which uuidgen || which uuid`"
sed -i "3i <article\n id=\"urn:uuid:`$UUIDGEN`\"\n title=\"\"\n href=\"\"\n author=\"\"\n published=\"\"\n updated=\"\">\n<details>\n<summary></summary>\n</details>\n<p>\n\n</p>\n</article>\n\n\n" $ENTRIES
if [ ! -z "$EDITOR" ]; then
case "$EDITOR" in
"nano" | "vim")
$EDITOR +13 $ENTRIES
;;
*)
$EDITOR $ENTRIES
;;
esac
fi