From 4a40c2cda178592ed6b7cc0ac43a57fe649adec2 Mon Sep 17 00:00:00 2001 From: Graham Watts <34165628+GingerGraham@users.noreply.github.com> Date: Wed, 3 Apr 2024 08:01:37 +0100 Subject: [PATCH] Reverting changes to path loop --- .github/scripts/convertH1toH2.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/scripts/convertH1toH2.sh b/.github/scripts/convertH1toH2.sh index 69d12dd..0f98379 100755 --- a/.github/scripts/convertH1toH2.sh +++ b/.github/scripts/convertH1toH2.sh @@ -1,16 +1,10 @@ -#!/bin/bash +#!/bin/sh basePath="./KnowledgeBase/" echo "[DEBUG] Converting all H1 to H2 in all markdown files in ${basePath}..." -find ${basePath} -type f \( -iname "*.md" ! -iname "*index*" ! -iname "*readme*" \) -exec sh -c ' - path="$1" - echo "[DEBUG] Converting all H1 to H2 in ${path}..." - # Replace all instances of # with ## - this converts all H1 to H2 - sed -i 's/\(^#\)\(\s\)/\#\#\2/g' "${path}" - echo "[DEBUG] All H1 converted to H2 in ${path}." -' sh {} \; +for path in $(find ${basePath} -type f \( -iname "*.md" ! -iname "*index*" ! -iname "*readme*" \) -print); do echo "[DEBUG] Converting all H1 to H2 in ${path}..." # Replace all instances of # with ## - this converts all H1 to H2 sed -i 's/\(^#\)\(\s\)/\#\#\2/g' "${path}"