/
todeLoad
executable file
·57 lines (44 loc) · 1.43 KB
/
todeLoad
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
#! /usr/bin/env bash
#=========================================================================
# Copyright (c) 2014, 2015, 2016 GemTalk Systems, LLC <dhenrich@gemtalksystems.com>.
#
# MIT license: https://github.com/GsDevKit/GsDevKit_home/blob/master/license.txt
#=========================================================================
theArgs="$*"
source "${GS_HOME}/bin/private/shFeedback"
start_banner
usage() {
cat <<HELP
USAGE: $(basename $0) [-h] <stone-name>
Install tODE in the given stone.
OPTIONS
-h display help
EXAMPLES
$(basename $0) -h
$(basename $0) gs_3281
"
HELP
}
if [ "${GS_HOME}x" = "x" ] ; then
exit_1_banner "the GS_HOME environment variable needs to be defined"
fi
source "${GS_HOME}/bin/defGsDevKit.env"
if [ "${GS_SERVER}x" = "x" ] ; then
exit_1_banner "the GsDevKit_server project has not been installed correctly or the GS_SERVER environment variable has not been defined"
fi
source "${GS_HOME}/bin/private/shFunctions"
getOpts_help $@
if [ $# -ne 1 ]; then
usage; exit_1_banner "Required positional paramter missing"
fi
stoneName=$1
"$GS_HOME/bin/startStone" -b $stoneName
echo "Install tODE on stone: $stoneName"
# set up stone environment
stonePath="$GS_SERVER_STONES/$stoneName"
pushd "$stonePath" >& /dev/null
source "$stonePath/stone.env"
popd >& /dev/null
# install tODE using gsDevKitTodeCommandLine
"$GS_HOME/bin/private/gsDevKitTodeCommandLine" loadTode $stoneName
exit_0_banner "...finished"