summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie Shprung <lshprung@scu.edu>2023-03-27 10:30:52 -0700
committerLouie Shprung <lshprung@scu.edu>2023-03-27 10:30:52 -0700
commit0a86453d2dcd84fc9cb989d1ae23fd1c19b0b4e9 (patch)
treeb97ee58a8cff1456abf6b4ceccae1677749f4c60
parent3c530aafe415db3515465e8b0662373065afd925 (diff)
Remove duplicates
-rw-r--r--Makefile3
-rwxr-xr-xsrc/index-page.sh2
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 5ab2219..1df05c6 100644
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,8 @@ $(INDEX_FILE): src/index-page.sh src/index-terms.sh $(DOCUMENTS_DIR)
src/index-terms.sh "Variable" $@ $(DOCUMENTS_DIR)/Index-of-Variables.html
src/index-terms.sh "Type" $@ $(DOCUMENTS_DIR)/Index-of-Data-Types.html
src/index-terms.sh "Hook" $@ $(DOCUMENTS_DIR)/Index-of-Hooks.html
- src/index-terms.sh "Option" $@ $(DOCUMENTS_DIR)/Index-of-Scanner-Options.html # TODO remove duplicates
+ src/index-terms.sh "Option" $@ $(DOCUMENTS_DIR)/Index-of-Scanner-Options.html
+ sqlite3 "$@" "DELETE FROM searchIndex WHERE EXISTS (SELECT 1 FROM searchIndex s2 WHERE searchIndex.name = s2.name AND searchIndex.type = s2.type AND searchIndex.type = \"Option\" AND searchIndex.rowid > s2.rowid)" # Remove duplicates
$(ICON_FILE): src/icon.png $(DOCSET_DIR)
cp $(SRC_ICON) $@
diff --git a/src/index-page.sh b/src/index-page.sh
index e26cdf8..55cd1ec 100755
--- a/src/index-page.sh
+++ b/src/index-page.sh
@@ -12,7 +12,7 @@ get_title() {
FILE="$1"
pup -p -f "$FILE" 'title text{}' | \
- sed 's/(Lexical Analysis With Flex.*)//' | \
+ sed 's/ (Lexical Analysis With Flex.*)//' | \
tr -d \\n | \
sed 's/\"/\"\"/g'
}