diff options
| author | Miroslav Kratochvil <miroslav.kratochvil@uni.lu> | 2023-10-16 11:37:27 +0200 |
|---|---|---|
| committer | Miroslav Kratochvil <miroslav.kratochvil@uni.lu> | 2023-10-16 11:37:27 +0200 |
| commit | fee144a3eca7e35b998061032f87d1e053999c6d (patch) | |
| tree | 4475ab5ad29f7ad4acbe875fe791ee1da68e8f5a /scripts/source-timestamps.sh | |
| parent | 4cdbf598c0e343384f8af3421d332ed15d8afe4e (diff) | |
| parent | 005b69dd472811d7a8e623c3761d476b5584b92c (diff) | |
| download | reploy-fee144a3eca7e35b998061032f87d1e053999c6d.tar.gz reploy-fee144a3eca7e35b998061032f87d1e053999c6d.tar.bz2 | |
Merge branch 'mk-howtocards-fixes' into 'master'
updates required for howto-cards
See merge request lcsb/sps/reploy!5
Diffstat (limited to 'scripts/source-timestamps.sh')
| -rwxr-xr-x | scripts/source-timestamps.sh | 10 |
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 |
