Skip to content

Commit

Permalink
add helpful information to bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Kersting committed Apr 29, 2024
1 parent b9076f9 commit cfdce20
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions runCrawler.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash

print_help () {
echo "Usage: ./runCrawler.sh -c={crawler name} --reset {optional: resets the data directory before running}"
echo "Example: ./runCrawler.sh -c=disa_pubs_spider --reset"
exit 1
}

RESET=false
CRAWLER=""
for i in "$@"; do
case $i in
-c=*|--crawler=*)
Expand All @@ -12,14 +19,17 @@ for i in "$@"; do
shift # past argument with no value
;;
-*|--*)
echo "Unknown option $i"
exit 1
print_help
;;
*)
;;
esac
done

if [$CRAWLER == ""]; then
echo "ERROR: Please use the -c option to specify a crawler"
print_help
fi

export PYTHONPATH="$(pwd)"
CRAWLER_DATA_ROOT=./tmp/$CRAWLER
Expand Down

0 comments on commit cfdce20

Please sign in to comment.