From 838b836e2b3e362a5ad8ad09b1b2d9c0e2f62639 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sun, 12 May 2024 23:14:54 +0300 Subject: [PATCH] cleaner --- .github/scripts/frontmatter.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/scripts/frontmatter.sh b/.github/scripts/frontmatter.sh index 9a29d7733e0..d147ca8aa15 100755 --- a/.github/scripts/frontmatter.sh +++ b/.github/scripts/frontmatter.sh @@ -23,8 +23,7 @@ is_true() { } # if file is empty -content=$(cat "$file_path") -if [ -z "$content" ]; then +if [ -z "$(cat "$file_path")" ]; then echo -e "---\n" >"$file_path" echo -e "---\n" >>"$file_path" fi @@ -32,9 +31,8 @@ fi echo "Checking front matter" if ! grep -q "^---$" "$file_path"; then echo "Front matter (start) not found, adding it" - content=$(cat "$file_path") echo -e "---\n" >"$file_path" - echo "$content" >>"$file_path" + echo "$(cat "$file_path")" >>"$file_path" fi # Get the title from the front matter