Revision 337,
1.6 KB
checked in by bartek, 8 years ago
(diff) |
version update to 1.6.2
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | fail() { |
---|
4 | echo -e '\033[01;41m'"$@"'\033[00m' |
---|
5 | exit 1 |
---|
6 | } |
---|
7 | |
---|
8 | PRODUCT_VERSION="1.6.2" |
---|
9 | TARGET="QCG-Icon-${PRODUCT_VERSION}-LinuxInstaller.sh" |
---|
10 | |
---|
11 | echo "ant clean" |
---|
12 | ant clean > /dev/null || fail "clean failed" |
---|
13 | echo "ant jar" |
---|
14 | ant jar > /dev/null || fail "jar failed" |
---|
15 | echo "Building script" |
---|
16 | |
---|
17 | cat << eof > "$TARGET" |
---|
18 | #!/bin/bash |
---|
19 | echo "Welcome to QCG-Icon 'installer'" |
---|
20 | echo -n " please specify target dir (or press return for default [qcg-icon]): " |
---|
21 | read tgt |
---|
22 | tgt="\${tgt:-qcg-icon}" |
---|
23 | tgt=\`eval echo \${tgt}\` |
---|
24 | echo "Installing QCG-Icon into \$tgt" |
---|
25 | if [[ ! -d "\${tgt}" ]] |
---|
26 | then |
---|
27 | if mkdir -p "\${tgt}" ; then :; else echo "Cannot create target dir"; exit 1 ; fi |
---|
28 | else |
---|
29 | ans= |
---|
30 | until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]] |
---|
31 | do |
---|
32 | ans= |
---|
33 | echo -n " dir exists, continue? [y/N]: " |
---|
34 | read ans |
---|
35 | ans="\${ans:-n}" |
---|
36 | done |
---|
37 | if [[ "\$ans" = n || "\$ans" = N ]] |
---|
38 | then |
---|
39 | echo "Cancelling instalation" |
---|
40 | exit 1 |
---|
41 | fi |
---|
42 | fi |
---|
43 | |
---|
44 | ARCHIVE=\`awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "\$0"\` |
---|
45 | tail -n+"\$ARCHIVE" "\$0" | tar xj -C "\${tgt}" |
---|
46 | |
---|
47 | if (( "\$?" == 0 )) |
---|
48 | then |
---|
49 | chmod a+x "\${tgt}/qcg-icon" |
---|
50 | echo "Installation finished." |
---|
51 | else |
---|
52 | echo "Installation failed!" |
---|
53 | exit 1 |
---|
54 | fi |
---|
55 | |
---|
56 | ans= |
---|
57 | until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]] |
---|
58 | do |
---|
59 | ans= |
---|
60 | echo -n " Run qcg-icon? [Y/n]: " |
---|
61 | read ans |
---|
62 | ans="\${ans:-y}" |
---|
63 | done |
---|
64 | if [[ "\$ans" = y || "\$ans" = Y ]] |
---|
65 | then |
---|
66 | ( cd "\${tgt}" && ./qcg-icon & disown ) |
---|
67 | exit 1 |
---|
68 | fi |
---|
69 | |
---|
70 | exit 0 |
---|
71 | |
---|
72 | __ARCHIVE__ |
---|
73 | eof |
---|
74 | |
---|
75 | echo "adding tar payload" |
---|
76 | tar cj --exclude-vcs -C dist lib QCG-Icon.jar -C ../dist_static logging.properties certs resources -C ../dist_linux config.properties qcg-icon >> ${TARGET} || fail "packing failed" |
---|
77 | |
---|
78 | chmod +x ${TARGET} |
---|
79 | echo "finished!" |
---|
80 | |
---|
81 | |
---|
Note: See
TracBrowser
for help on using the repository browser.