-
Notifications
You must be signed in to change notification settings - Fork 12
/
prepare.sh
executable file
·59 lines (49 loc) · 1.18 KB
/
prepare.sh
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
#!/usr/bin/env zsh
set -o errexit
set -o nounset
__initial_env=( $(env | sed 's/=\(.*\)$/='\'\\1\''/') )
if (( UID ))
then
printf "This script should be run only by root, you can use sudo to do that.\n"
exit 1
fi
if [[ -r /etc/rixrc ]]
then
source /etc/rixrc
else
printf '/etc/rixrc does not exists,\n\
it should contain paths to local checkout of sm and rvm\n\
export sm_local_path=/path/to/sm\n\
export rvm_local_path=/path/to/rvm\n\
export installbuilder_path=/path/to/installbuilder\n'
exit 1
fi
if [[ -z "$sm_local_path" || ! -d "$sm_local_path" ]]
then
printf "sm_local_path='${sm_local_path:-}' is not pointing on a direcotory.\n"
exit 1
fi
if [[ -z "${rvm_local_path:-}" || ! -d "${rvm_local_path}" ]]
then
printf "rvm_local_path='${rvm_local_path:-}' is not pointing on a direcotory.\n"
exit 1
fi
export initial_pwd sm_path modules_path sm_script extensions_search_paths
initial_pwd="$PWD"
sm_path="$sm_local_path"
modules_path="${sm_path}/core/sm/shell"
sm_script=/
extensions_search_paths=( $PWD/sm )
. "${modules_path}/core/cli"
. "${modules_path}/core/initialize"
includes rix
TRAPZERR(){
rix.failed
}
TRAPINT(){
rix.failed
}
TRAPEXIT(){
rix.end
}
rix.start