Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 8 insertions, 5 deletions
-rwxr-xr-xcsg13
diff --git a/csg b/csg
index 53a6f70..c145ca2 100755
--- a/csg
+++ b/csg
@@ -131,12 +131,15 @@ endTimer() {
if [ -n "$CSG_TIMESTAMP_FILE" ] && isCommand 'git'
then
timestamps_writeDates() {
- for file in $(find . -type f -name '*.md')
+ while read -r file
do
- dates=($(git log --follow --pretty=format:%ad --date="format:%d %B %Y" -- "$file"))
- line="$DESTINATION${file:1:-2}html\t${dates[@]: -3:3} ${dates[@]:0:3}"
- echo -e "$line" >> "$CSG_TIMESTAMP_FILE"
- done
+ git log --follow --pretty=format:%ad --date="format:%d %B %Y" -- "$file" | $CSG_AWK -v dest="$DESTINATION" -v file="$file" '
+ BEGIN { file = dest substr(file, 2, length(file) - 3) "html" }
+ NR == 1 { later = $0 }
+ END { print file "\t" $0 "\t" later }' >> "$CSG_TIMESTAMP_FILE"
+ done << EOF
+$(find . -type f -name '*.md')
+EOF
}
headc="$(git rev-parse HEAD)"