-
Notifications
You must be signed in to change notification settings - Fork 3
/
find_regimentd
executable file
·58 lines (47 loc) · 1.58 KB
/
find_regimentd
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
#!/bin/bash
# This is a hack.
# But it's a hack with a noble purpose. We want things to work out of
# the box no matter what. Nothing more annoying than getting a "can't
# find X" error when you just want the thing to work.
# Thus, even if we haven't bound REGIMENTD, or run
# install_environment_vars like we should have... This script
# heuristically tries to find SOME kind of workable REGIMENTD.
if [ "$REGIMENTD" == "" ];
then echo Env var '$REGIMENTD' is not bound. >&2;
elif [ -d "$REGIMENTD" ];
then exit 0;
else echo Directory '$REGIMENTD' does not existing. >&2;
fi
echo You should bind it, or source the 'install_environment_vars' >&2;
echo script in your Wavescript/Regiment working copy. >&2;
echo >&2;
echo Searching... >&2;
inner () {
DIR=$1
if [ -f "$DIR/bin/regiment" ] && [ -f "$DIR/src/main.ss" ];
then echo Found seemingly usable REGIMEND dir: >&2;
echo " "$DIR >&2;
#export REGIMEND=$1
echo $DIR;
exit 0;
fi
}
outer () {
DIR=$1
D="$DIR/wavescript"
if [ -d "$D" ]; then inner "$D"; fi
D="$DIR/WaveScope/code/wavescript"
if [ -d "$D" ]; then inner "$D"; fi
D="$DIR/Wavescope/code/wavescript"
if [ -d "$D" ]; then inner "$D"; fi
D="$DIR/wavescope/code/wavescript"
if [ -d "$D" ]; then inner "$D"; fi
D="$DIR/wavescope"
if [ -d "$D" ]; then inner "$D"; fi
}
outer $HOME
outer `pwd | sed 's/wavescript.*$//'`
outer /usr
outer $HOME/cvs
outer $HOME/svn
# Could use locate!