X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=searchindex.sh;h=162fad12e72109af68e6ad3365142112202affb6;hb=08ecb8b08cd5a1cf5cc7507e9d41fb3e09e24c5d;hp=526877dc7de0ffc2f540e39fe3226d06b5a12f7a;hpb=65b04e000d563f2347370cbf3e1e01cf2af0a168;p=shellwiki diff --git a/searchindex.sh b/searchindex.sh index 526877d..162fad1 100755 --- a/searchindex.sh +++ b/searchindex.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2023 Paul Hänsch +# Copyright 2023, 2024 Paul Hänsch # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -87,6 +87,7 @@ help() { while [ $# -gt 0 ]; do case $1 in --exec|-e) _EXEC="${2%/}"; shift 2;; --data|-d) _DATA="${2%/}"; shift 2;; + --location) location="${2}"; shift 2;; --verbose|-v) verb=true; shift 1;; --force) force=true; shift 1;; --help) help 0 2>&1;; @@ -134,7 +135,7 @@ prune() { } index() { - export PATH_INFO="" _DATE="$(date +%s)" + export PATH_INFO="" _DATE="$(date +%s)" SEARCH_INDEX=true if [ "$location" ]; then location="${location#/}" location="${location%/}" @@ -151,6 +152,7 @@ index() { then [ "$verb" ] && printf "%${v}s\r%s\r" "" "$PATH_INFO" >&2 v="${#PATH_INFO}" + cd -- "$_DATA/pages/$PATH_INFO" "$_EXEC/parsers/40_indexer.sh" <"$_DATA/pages/$PATH_INFO/#page.md" >/dev/null fi done