From a69538ff4b1bc74ff8410257d887dddcdb8fab2c Mon Sep 17 00:00:00 2001 From: Md Mijanur Rahman Date: Sat, 16 Mar 2024 22:32:52 +0100 Subject: [PATCH] Refactor code to improve performance and readability --- .github/workflows/update_readme.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_readme.yml b/.github/workflows/update_readme.yml index 3f746025..85104927 100644 --- a/.github/workflows/update_readme.yml +++ b/.github/workflows/update_readme.yml @@ -17,7 +17,6 @@ jobs: run: | # Read the content of best_runs.md file content=$(cat results/best_runs.md) - echo "Content from best_runs.md:" echo "$content" - name: Update README.md @@ -25,8 +24,9 @@ jobs: # Read the content of README.md readme_content=$(cat README.md) - # Insert new content at line 57 - updated_readme_content=$(awk -v content="$content" 'NR == 57 {print content} {print}' README.md) + # Replace content between and + new_content="\n$content\n" + updated_readme_content=$(echo "$readme_content" | sed -e '//, //c\'"$new_content") # Update README.md echo "$updated_readme_content" > README.md