updated scripts to add optional param so hook can pass tmpdir to gen_feed_item
authorMatthewOwens <matthew@owens.tech>
Sun, 19 Jul 2020 12:36:28 +0000 (13:36 +0100)
committerMatthewOwens <matthew@owens.tech>
Sun, 19 Jul 2020 12:36:28 +0000 (13:36 +0100)
scripts/gen_feed.sh
scripts/gen_feed_item.sh

index 5ca1292..ac8867b 100755 (executable)
@@ -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'
index 6c54ad0..a493584 100755 (executable)
@@ -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>"