From 619372d6ae131f3afff44911e6912a3c75110191 Mon Sep 17 00:00:00 2001
From: MatthewOwens <matthew@owens.tech>
Date: Sun, 19 Jul 2020 13:36:28 +0100
Subject: [PATCH] updated scripts to add optional param so hook can pass tmpdir
 to gen_feed_item

---
 scripts/gen_feed.sh      | 2 +-
 scripts/gen_feed_item.sh | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/gen_feed.sh b/scripts/gen_feed.sh
index 5ca1292..ac8867b 100755
--- a/scripts/gen_feed.sh
+++ b/scripts/gen_feed.sh
@@ -13,7 +13,7 @@ printf '\t<atom:link href="https://owens.tech/rss.xml" rel="self" type="applicat
 # generate
 
 printf '\n\n'
-find posts/ -type f -exec sh -c "scripts/gen_feed_item.sh {}" \;
+find posts/ -type f -exec sh -c "scripts/gen_feed_item.sh {} $1" \;
 printf '\n\n'
 
 printf '</channel>\n'
diff --git a/scripts/gen_feed_item.sh b/scripts/gen_feed_item.sh
index 6c54ad0..a493584 100755
--- a/scripts/gen_feed_item.sh
+++ b/scripts/gen_feed_item.sh
@@ -1,10 +1,10 @@
 # ensuring that at least that the post md file is passed in
-[ $# -eq 1 ] || exit 1
+[ $# -eq 0 ] && exit 1
 
 HTMLPATH=$(echo $1 | sed 's/\.md$/.html/')
 TITLE=$(scripts/post_title.sh $1)
 BODY=$(markdown $1 | sed -e 's/&rsquo;/'/g -e 's/&lsquo;//g')
-DATE=$(git log -1 --pretty="format:%ad" $1)
+DATE=$(git log -1 --pretty="format:%ad" $2$1)
 
 echo "<item>"
 echo "	<title>$TITLE</title>"
-- 
2.20.1