Skip to content

Commit

Permalink
Reverting changes to path loop
Browse files Browse the repository at this point in the history
  • Loading branch information
GingerGraham committed Apr 3, 2024
1 parent b600945 commit 4a40c2c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/scripts/convertH1toH2.sh
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down

0 comments on commit 4a40c2c

Please sign in to comment.