mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-17 05:56:20 +00:00
32 lines
1.1 KiB
Bash
32 lines
1.1 KiB
Bash
![]() |
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
SCRIPT_DIR=$(dirname "$(realpath "$0")")
|
||
|
cd "$SCRIPT_DIR"/.. || exit 1
|
||
|
OUTPUT_FOLDER_NAME=Sharepoint
|
||
|
OUTPUT_DIR=$SCRIPT_DIR/structured-output/$OUTPUT_FOLDER_NAME
|
||
|
DOWNLOAD_DIR=$SCRIPT_DIR/download/$OUTPUT_FOLDER_NAME
|
||
|
|
||
|
if [ -z "$SHAREPOINT_CLIENT_ID" ] || [ -z "$SHAREPOINT_CRED" ]; then
|
||
|
echo "Skipping Sharepoint ingest test because the MS_CLIENT_ID or MS_CLIENT_CRED env var is not set."
|
||
|
exit 0
|
||
|
fi
|
||
|
# excluding metadata.last_modified since this will always update as date processed because the Sharepoint connector creates documents on the fly
|
||
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
||
|
sharepoint \
|
||
|
--download-dir "$DOWNLOAD_DIR" \
|
||
|
--metadata-exclude file_directory,metadata.data_source.date_processed,metadata.last_modified \
|
||
|
--num-processes 2 \
|
||
|
--partition-strategy hi_res \
|
||
|
--preserve-downloads \
|
||
|
--reprocess \
|
||
|
--structured-output-dir "$OUTPUT_DIR" \
|
||
|
--verbose \
|
||
|
--client-cred "$SHAREPOINT_CRED" \
|
||
|
--client-id "$SHAREPOINT_CLIENT_ID" \
|
||
|
--site "$SHAREPOINT_SITE" \
|
||
|
--path "Shared Documents" \
|
||
|
--recursive \
|
||
|
|
||
|
sh "$SCRIPT_DIR"/check-diff-expected-output.sh $OUTPUT_FOLDER_NAME
|