-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgo.sh
executable file
·73 lines (51 loc) · 938 Bytes
/
go.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#
# Wrapper script to download a bucket's contents, cache
# the results, and then report on the contents of that bucket.
#
# Errors are fatal
set -e
#
# Print our syntax and exit.
#
function printSyntax() {
echo "! "
echo "! Syntax: $0 bucket"
echo "! "
exit 1
} # End of printSyntax()
#
# Parse our args
#
function parseArgs() {
while test "$1"
do
ARG=$1
shift
if test "$ARG" == "-h" -o "$ARG" == "--help"
then
printSyntax
else
BUCKET=$ARG
fi
done
if test ! "$BUCKET"
then
printSyntax
fi
} # End of parseArgs()
parseArgs $@
OUTPUT="$BUCKET.json"
#
# If the output file already exists, skip re-fetching it.
#
if test -f "$OUTPUT"
then
echo "# " 1>&2
echo "# Output file '$OUTPUT' already exists, skipping!" 1>&2
echo "# " 1>&2
else
./1-get-bucket-contents.py $BUCKET $OUTPUT
fi
./2-process-bucket-contents.py $OUTPUT --humanize
#./2-process-bucket-contents.py $OUTPUT