From 0569fa14d9bfc07f5fcffebb3c53c3b9aa6a7592 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Fri, 30 Dec 2022 10:04:55 -0800 Subject: Package GNU Autoconf Archive --- src/index.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/index.sh') diff --git a/src/index.sh b/src/index.sh index e81a0f7..4d4b12b 100755 --- a/src/index.sh +++ b/src/index.sh @@ -6,14 +6,14 @@ shift get_title() { FILE="$1" - PATTERN=".*\(Autoconf\).*" + PATTERN=".*\(Autoconf Archive\).*" #Find pattern in file grep -Eo "$PATTERN" "$FILE" | #Remove tag sed 's/<[^>]*>//g' | \ #Remove '(automake)' - sed 's/(Autoconf)//g' | \ + sed 's/(Autoconf Archive)//g' | \ #Remove trailing space sed 's/[ ]*$//g' | \ #Replace '&' with '&' @@ -23,17 +23,12 @@ get_title() { } get_type() { - FILE="$1" - PATTERN="The node you are looking for is at.*Limitations-of-.*\.html;Builtin - The node you are looking for is at;Macro" + FILE="$(basename $1)" + MACRO_PATTERN="^ax_" - echo "$PATTERN" | while read -r line; do - #echo "$line" - if grep -Eq "$(echo "$line" | cut -d ';' -f 1)" "$FILE"; then - echo "$line" | cut -d ';' -f 2 - break - fi - done + if echo "$FILE" | grep -q "$MACRO_PATTERN"; then + echo "Macro" + fi } insert() { -- cgit