From 7f252ed2e50e01cda27ce2e3a327ece6e6fc463f Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sun, 12 May 2024 23:12:42 +0300 Subject: [PATCH] hmm --- .github/scripts/frontmatter.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/scripts/frontmatter.sh b/.github/scripts/frontmatter.sh index a591a7b6d2e..9a29d7733e0 100755 --- a/.github/scripts/frontmatter.sh +++ b/.github/scripts/frontmatter.sh @@ -22,6 +22,13 @@ is_true() { return 1 } +# if file is empty +content=$(cat "$file_path") +if [ -z "$content" ]; then + echo -e "---\n" >"$file_path" + echo -e "---\n" >>"$file_path" +fi + echo "Checking front matter" if ! grep -q "^---$" "$file_path"; then echo "Front matter (start) not found, adding it"