btter
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user