diff options
Diffstat (limited to 'lib/atomfeed.source.sh')
| -rw-r--r-- | lib/atomfeed.source.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh index d614fe0..059bdda 100644 --- a/lib/atomfeed.source.sh +++ b/lib/atomfeed.source.sh @@ -115,7 +115,7 @@ atomfeed::_entry () { assert::not_empty summary "$summary" # Extract the date from the file name. - local date=$($SED -n '/^> Published at / { s/.*Published at //; s/;.*//; p; }' "$gemfeed_dir/$gmi_file") + local date=$(head "$gemfeed_dir/$gmi_file" | $SED -n '/^> Published at / { s/.*Published at //; s/;.*//; p; }') if [ -z "$date" ]; then # Extract the date from the file. date=$($DATE $DATE_FORMAT --reference "$gemfeed_dir/$gmi_file") @@ -173,4 +173,8 @@ atomfeed::_insert_date () { } > "$gmi_file_path.insert.tmp" mv "$gmi_file_path.insert.tmp" "$gmi_file_path" + + if [ -f "$gmi_file_path.tpl" ]; then + atomfeed::_insert_date "$date" "$gmi_file_path.tpl" + fi } |
