diff options
[hooks] Reworked generate hooks to use a string of all files to work on, rather than having to find it
1 files changed, 2 insertions, 2 deletions
| -rwxr-xr-x | generate-hooks/make-descriptions.sh | 4 |
diff --git a/generate-hooks/make-descriptions.sh b/generate-hooks/make-descriptions.sh index 8268019..1ea7a9f 100755 --- a/generate-hooks/make-descriptions.sh +++ b/generate-hooks/make-descriptions.sh @@ -1,12 +1,11 @@ #!/bin/bash if [ -z "$1" ]; then - echo First parameter must be a path + echo First parameter must be string with file paths exit fi # Loop through all HTML files in given directory -for file in $(find "$1" -type f -name "*.html"); do # Get text that matches "p>any amount of characters</p" from current file # remove the "p>" and "</p" from result # make everything that starts with "<" blank @@ -20,6 +19,7 @@ for file in $(find "$1" -type f -name "*.html"); do # Escape all non-acceptable characters (thanks https://www.unix.com/302989284-post3.html) description=$(echo $description | sed 's/[^a-zA-Z 0-9]/\\&/g') +for file in $1; do # Replace all "[DESCRIPTION]" text in current file with what we selected (inside description) sed -i "s/\[DESCRIPTION\]/$description/g" $file |