forked from GsDevKit/gsDevKitHome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperformTodeCommand
executable file
·44 lines (33 loc) · 1.02 KB
/
performTodeCommand
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
#! /bin/bash
#=========================================================================
# Copyright (c) 2015 GemTalk Systems, LLC <[email protected]>.
#=========================================================================
echo "================="
echo " GsDevKit script: $(basename $0) $*"
echo "================="
usage() {
cat <<HELP
USAGE: $(basename $0) [-h] <stone-name> <tode-command-line>
Execute the <tode-command-line> as a tODE command
OPTIONS
-h show usage
EXAMPLES
$(basename $0) -h
$(basename $0) devkit project load Seaside3
$(basename $0) devkit eval \`3+4\`
$(basename $0) devkit eval \`3+4\`\; eval \`self == 7 ifFalse: [ System logout ]\`
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
source ${GS_HOME}/bin/shFunctions
getOpts_help $@ #parse standard (-h) options
stoneName="$1"
shift
echo "performing: __$*__"
$GS_HOME/bin/tode todeIt $stoneName << EOF
$*
EOF
echo "...finished $(basename $0)"