forked from zouzg/mybatis-generator-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·62 lines (52 loc) · 1.57 KB
/
install.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
#!/bin/bash
echo "[Requirement-Java] Requirement JDK 8.0+ and env of JAVA_HOME."
if [ -z "${JAVA_HOME}" ]; then
echo "[Requirement-Java] JAVA_HOME is not exists!"
echo "[Requirement-Java] Please check java is installed and set env of JAVA_HOME."
exit 1
else
echo "[Requirement-Java] JAVA_HOME: ${JAVA_HOME}"
fi
if [ ! -x "${JAVA_HOME}/bin/javac" ]; then
echo "[Requirement-Java] Java not found!"
echo "[Requirement-Java] Please install JDK 8.0+ or JRE 8.0+"
exit 1
fi
JAVA_VERSION=`java -version 2>&1 |awk 'NR==1{ gsub(/"/,""); print $3 }'`
echo "[Requirement-Java] JAVA_VERSION: ${JAVA_VERSION}"
if [[ "$JAVA_VERSION" < "1.8" ]]; then
echo "[Requirement-Java] Please install JDK 8.0+ or JRE 8.0+"
exit 1
fi
echo "[Requirement-Maven] Requirement install Maven and set the PATH."
if [ -z "${MAVEN_HOME}" ]; then
echo "[Requirement-Maven] MAVEN_HOME is not exists!"
echo "[Requirement-Maven] Please check maven is installed and set env of MAVEN_HOME."
exit 1
else
echo "[Requirement-Java] MAVEN_HOME: ${MAVEN_HOME}"
fi
cd `dirname $0`
BIN_DIR=`pwd`
echo "[Requirement-BIN_DIR] BIN_DIR: ${BIN_DIR}"
mvn clean jfx:jar
if [ $? -ne 0 ]; then
echo "Quit because maven install fail"
exit -1
fi
cp start.sh "${BIN_DIR}/target/jfx/app"
if [ $? -ne 0 ]; then
echo "Copy start.sh fail"
exit -1
fi
cd "${BIN_DIR}/target/jfx/app"
tar -zcvf mybatis-generator-gui-no-jre.tar.gz *
if [ $? -ne 0 ]; then
echo "tar jar fail"
exit -1
fi
cp "${BIN_DIR}/target/jfx/app/mybatis-generator-gui-no-jre.tar.gz" "${BIN_DIR}"
if [ $? -ne 0 ]; then
echo "Copy jar fail"
exit -1
fi