terraform/scripts/update-test-record.sh
2023-03-08 14:13:17 +08:00

25 lines
504 B
Bash

#!/usr/bin/env bash
git config --global --add safe.directory '*'
if [ ! -d "TestRecord" ]; then
echo "No TestRecord found, exit"
exit 0
fi
cd TestRecord
folders=$(find ./ -maxdepth 1 -mindepth 1 -type d)
for f in $folders; do
d=${f#"./"}
if [ ! -f ../quickstart/$d/TestRecord.md ]; then
touch ../quickstart/$d/TestRecord.md
fi
cat ../quickstart/$d/TestRecord.md >> $d/TestRecord.md.tmp
cat $d/TestRecord.md.tmp > ../quickstart/$d/TestRecord.md
done
cd ..
git add **/TestRecord.md