-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathquery
executable file
·36 lines (28 loc) · 963 Bytes
/
query
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
# Convenience script to query for a similar files of a given file
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.QueryApp"
hash java >/dev/null 2>&1 || { echo "Please install Java" >&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