This commit is contained in:
Stavros Kois
2024-05-13 01:07:37 +03:00
committed by GitHub
parent 95b2826937
commit ac3fe05425
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -27,10 +27,7 @@ if ! head -n 1 "$file_path" | grep -q "---"; then
echo "Front matter (start) not found, adding it"
# Dont trace content, as its usually too large
[ "$DEBUG" == "true" ] && set +x
content=$(cat "$file_path")
echo -e "---\n" >"$file_path"
echo -e "---\n" >>"$file_path"
echo "$content" >>"$file_path"
(echo -e "---\n---\n"; cat "$file_path") >"$file_path.tmp" && mv "$file_path.tmp" "$file_path"
[ "$DEBUG" == "true" ] && set -x
fi