aboutsummaryrefslogtreecommitdiff
path: root/scripts/source-timestamps.sh
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2023-10-15 23:29:19 +0200
committerMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-10-16 11:34:26 +0200
commit318d603c51a730a9d55f0f44b2ffff5874cfb5cb (patch)
treed9b974860c7251404c71839d341952b715ab116a /scripts/source-timestamps.sh
parent32529c8c0fdf49f69ba1cf16aeb3deab6d272f5c (diff)
downloadreploy-318d603c51a730a9d55f0f44b2ffff5874cfb5cb.tar.gz
reploy-318d603c51a730a9d55f0f44b2ffff5874cfb5cb.tar.bz2
fixup the timestamp-sourcing script
Diffstat (limited to 'scripts/source-timestamps.sh')
-rwxr-xr-xscripts/source-timestamps.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/source-timestamps.sh b/scripts/source-timestamps.sh
index 5bce4de..ce30cf9 100755
--- a/scripts/source-timestamps.sh
+++ b/scripts/source-timestamps.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Copyright (C) 2023 University of Luxembourg
@@ -30,13 +30,13 @@ do
find "$1" -type f -name '*.md' | grep -v "$NOT_SOURCE_REGEX" | while read file ; do
fn=`basename "$file"`
dir=`dirname "$file"`
- tsfn="$fn.timestamp"
+ outfn="$fn.metadata.yml"
(
- echo "making timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE"
+ echo "adding timestamp in '$dir' for file '$fn' ..." >> "$LOGFILE"
cd "$dir"
- if [ -f "$tsfn" ]
+ if grep -q -s "^timestamp:" "$outfn"
then echo "... but it already exists; skipping!" >> "$LOGFILE"
- else git log -n 1 --pretty=format:%cs -- "$fn" > "$tsfn"
+ else git log -n 1 --pretty=format:$'timestamp: %cs\n' -- "$fn" >> "$outfn"
fi
)
done