1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # This script can be run from any directory, but the script file itself
|
---|
4 | # NEEDS TO BE IN THE TOP-LEVEL GREENSTONE3 SRC HOME DIRECTORY
|
---|
5 |
|
---|
6 | store_pwd="$(pwd)"
|
---|
7 | full_progdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
|
---|
8 | cd "$full_progdir"
|
---|
9 |
|
---|
10 | if [ "x$GSDL3SRCHOME" = "x" ] ; then
|
---|
11 | if [ -f SETUP.bash ] ; then
|
---|
12 | . ./SETUP.bash
|
---|
13 | fi
|
---|
14 | fi
|
---|
15 |
|
---|
16 | if test "x$gsopt_noexts" != "x1" ; then
|
---|
17 |
|
---|
18 | echo ""
|
---|
19 | echo "----"
|
---|
20 | echo "Checking for custom ant-start extension settings (ant-start-settings.bash)"
|
---|
21 | echo "----"
|
---|
22 |
|
---|
23 | # Check Greenstone3 extensions
|
---|
24 | if [ -d ext ] ; then
|
---|
25 | for gsdl_ext in ext/* ; do
|
---|
26 | if [[ "$gsdl_ext" == *.inactive ]]; then
|
---|
27 | echo "Skipping inactive extension $gsdl_ext"
|
---|
28 | continue
|
---|
29 | fi
|
---|
30 | # Sourcing first for settings, then run ext's 'start' script if it exists
|
---|
31 | if [ -d $gsdl_ext ] ; then
|
---|
32 | cd $gsdl_ext > /dev/null
|
---|
33 | if [ -f ant-start-settings.bash ]; then
|
---|
34 | . ./ant-start-settings.bash
|
---|
35 | fi
|
---|
36 | if [ -f ant-start.sh ]; then
|
---|
37 | ./ant-start.sh
|
---|
38 | fi
|
---|
39 | cd ../..
|
---|
40 | fi
|
---|
41 | done
|
---|
42 | fi
|
---|
43 |
|
---|
44 | # Check Greenstone2 extensions
|
---|
45 | if [ -d gs2build/ext ] ; then
|
---|
46 | for gsdl_ext in gs2build/ext/* ; do
|
---|
47 | if [[ "$gsdl_ext" == *.inactive ]]; then
|
---|
48 | echo "Skipping inactive extension $gsdl_ext"
|
---|
49 | continue
|
---|
50 | fi
|
---|
51 | # Sourcing first for settings, then run ext's 'start' script if it exists
|
---|
52 | if [ -d $gsdl_ext ] ; then
|
---|
53 | cd $gsdl_ext > /dev/null
|
---|
54 | if [ -f ant-start-settings.bash ]; then
|
---|
55 | . ./ant-start-settings.bash
|
---|
56 | fi
|
---|
57 | if [ -f ant-start.sh ]; then
|
---|
58 | ./ant-start.sh
|
---|
59 | fi
|
---|
60 | cd ../../..
|
---|
61 | fi
|
---|
62 | done
|
---|
63 | fi
|
---|
64 | fi
|
---|
65 |
|
---|
66 |
|
---|
67 | # If needed, add any further customized code needed here, such as
|
---|
68 | # environemnt variables
|
---|
69 |
|
---|
70 |
|
---|
71 | ant start
|
---|
72 |
|
---|
73 | # Any customized clean up needed?
|
---|
74 |
|
---|
75 |
|
---|
76 | cd "$store_pwd"
|
---|