-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathreport
executable file
·38 lines (29 loc) · 1.03 KB
/
report
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
#!/bin/bash
# Convenience script to find all similar files among already hashed repositories
E_BUILD_FAILED=142
jar="target/gemini-uber.jar"
deps_jar="target/gemini-deps.jar"
build_command="./sbt assembly"
build_deps_command="./sbt assemblyPackageDependency"
current_dir="$(dirname "$0")"
app_class="tech.sourced.gemini.cmd.ReportApp"
hash java >/dev/null 2>&1 || { echo "Please install Java" >&2; exit 1; }
hash python3 >/dev/null 2>&1 || { echo "Please install python3" >&2; exit 1; }
if [[ ! -f "${deps_jar}" ]]; then
echo "${deps_jar} not found. Running build '${build_deps_command}'"
if ! $build_deps_command ; then
exit "${E_BUILD_FAILED}"
fi
fi
if [[ ! -f "${jar}" ]]; then
echo "${jar} not found. Running build '${build_command}'"
if ! $build_command ; then
exit "${E_BUILD_FAILED}"
fi
fi
if [[ -n "$DEV" ]]; then
echo "Development mode: ON. Using ./sbt to build and run can be slow"
exec ./sbt --warn "run-main ${app_class} $*"
else
exec java -cp "${jar}:${deps_jar}" "${app_class}" $@
fi