-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathinstallTodeProjectStone
More file actions
executable file
·65 lines (51 loc) · 1.53 KB
/
installTodeProjectStone
File metadata and controls
executable file
·65 lines (51 loc) · 1.53 KB
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
63
64
65
#! /bin/bash
#=========================================================================
# Copyright (c) 2015 GemTalk Systems, LLC <[email protected]>.
#=========================================================================
echo "================="
echo " GsDevKit script: $(basename $0) $*"
echo "================="
usage() {
cat <<HELP
USAGE: $(basename $0) [-h] [-b <backup-name>] <stone-name> <project-name>
Load the project named <project-name> into <stone-name>. The installation of <project-name>
is based upon the informaton in the tODE project entry for the project. A backup is
made when the script completes. By default, the backup is named <project-name>.dbf unless
you specify an alternate backup name with the -b option.
tODE must be installed before running this script.
OPTIONS
-h
show usage
-b <backup-name>
Use <backup-name> as the name of the backup file
EXAMPLES
$(basename $0) -h
$(basename $0) devkit Flow
HELP
}
set -e # exit on error
if [ "${GS_HOME}x" = "x" ] ; then
echo "the GS_HOME environment variable needs to be defined"; exit 1
fi
backupName=""
while getopts "b:h" OPT ; do
case "$OPT" in
s) backupName="${OPTARG}";;
h) usage; exit 0;;
*) usage; exit 1;;
esac
done
shift $(($OPTIND - 1))
if [ "${backupName}x" = "x" ] ; then
backupName="${projectName}"
fi
if [ $# -ne 2 ]; then
usage; exit 1
fi
stoneName="$1"
projectName="$2"
$GS_HOME/bin/tode todeIt $stoneName << EOF
project load ${projectName}
bu backup ${backupName}.dbf
EOF
echo "...finished $(basename $0)"