forked from holmari/gerritstats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gerrit_stats.sh
executable file
·36 lines (30 loc) · 942 Bytes
/
gerrit_stats.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
#!/bin/bash
#
# Runs GerritStats, generating HTML output by default.
#
script_path="$(cd "$(dirname -- "$0")" || exit 1; pwd -P)"
output_dir="$script_path/out-html"
new_args=()
index=0
next_is_output_dir=""
for arg in "$@"; do
if [ "$next_is_output_dir" != "" ]; then
output_dir="$arg"
next_is_output_dir=""
elif [ "$arg" == "-o" ]; then
next_is_output_dir="1"
else
new_args[$index]="$arg"
let "index += 1"
fi
done
cd "$script_path" || exit 1
rm -rf GerritStats/out-html/data && \
java -Xmx4096m -Xms256m -jar GerritStats/build/libs/GerritStats.jar \
-o GerritStats/out-html/data "${new_args[@]}" || exit 1
cd "$script_path/GerritStats" || exit 1
npm run webpack && \
mkdir -p "$output_dir/data" && \
cp -r "$script_path/GerritStats/out-html/data" "$output_dir/" && \
cp -r "$script_path/GerritStats/out-html/"* "$output_dir/"
echo "Output generated to $output_dir"