From 3798ad8f827a3dadeb803b0c4bc06179ae90fd95 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 21 Apr 2010 21:18:53 +1200 Subject: Add build-journal and journal-note. --- build-journal | 6 ++++++ debian/changelog | 6 ++++++ debian/liw-automation.install | 2 ++ journal-note | 46 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 build-journal create mode 100644 journal-note diff --git a/build-journal b/build-journal new file mode 100644 index 0000000..cf12f3f --- /dev/null +++ b/build-journal @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +ikiwiki --setup $HOME/Journal/ikiwiki.setup + diff --git a/debian/changelog b/debian/changelog index 5dd13f5..8675c6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +liw-automation (3) squeeze; urgency=low + + * Add build-journal and journal-note. + + -- Lars Wirzenius Wed, 21 Apr 2010 21:18:29 +1200 + liw-automation (2) squeeze; urgency=low * Add g. diff --git a/debian/liw-automation.install b/debian/liw-automation.install index 6bfcf47..8d4ed04 100644 --- a/debian/liw-automation.install +++ b/debian/liw-automation.install @@ -1,2 +1,4 @@ sync-to-pieni usr/bin g usr/bin +build-journal usr/bin +journal-note usr/bin diff --git a/journal-note b/journal-note new file mode 100644 index 0000000..eeed7a3 --- /dev/null +++ b/journal-note @@ -0,0 +1,46 @@ +#!/bin/sh + +set -e + +if [ "$#" != 1 ] +then + echo "Usage: $0 title" + exit 1 +fi + +title="$1" +temp="$(mktemp)" + +cat << eof > "$temp" +[[!meta title="$title"]] +[[!tag ]] +[[!meta date="$(date +%Y-%m-%dT%H:%M)"]] + +eof + +checksum="$(mktemp)" +md5sum "$temp" > "$checksum" +vi "$temp" +if md5sum --status -c "$checksum" +then + echo "No change to note, aborting." + rm "$temp" "$checksum" + exit 1 +fi + +cat << eof >> "$temp" + +[[!meta done="$(date +%Y-%m-%dT%H:%M)"]] +eof + +cd "$HOME/Journal/src" +filename="notes/$(date +%Y-%m-%d-%H:%M.mdwn)" +if [ -e "$filename" ] +then + filename="notes/$(date +%Y-%m-%d-%H:%M:%S.mdwn)" +fi +cp "$temp" "$filename" +bzr add "$filename" +bzr commit -m "New note" "$filename" +ikiwiki --setup ../ikiwiki.setup --refresh +rm "$temp" "$checksum" -- cgit v1.2.1