22 lines
488 B
Bash
22 lines
488 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
|
||
|
|
## Usage:
|
||
|
|
## ./scrape_docs.bash [path]
|
||
|
|
## [path] is the starting point for searching for HTML. Ideally this is the siteroot
|
||
|
|
## script will find all HTML files and record them into a CSV file that can be used for searching docs.
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
SCRIPT_PATH=$(cd "$(dirname "$0")"; pwd -P)
|
||
|
|
|
||
|
|
path_to_docs=$(realpath "$1")
|
||
|
|
|
||
|
|
cd "$SCRIPT_PATH"
|
||
|
|
|
||
|
|
pages=$(
|
||
|
|
cd "$path_to_docs";
|
||
|
|
find ./ -iname "*.html" -printf '/%P,'
|
||
|
|
)
|
||
|
|
|
||
|
|
echo "$pages" > "$path_to_docs/pagelist.txt"
|