-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathprepare_local.sh
executable file
·46 lines (40 loc) · 1.15 KB
/
prepare_local.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
#!/usr/bin/env sh
PROJECTS=$1
BUILDER=$2
if
[[ -z "$PROJECTS" || -z "$BUILDER" ]]
then
printf "Use\n $0 /path/to/projects /path/to/installbuilder\n"
exit 1
fi
[[ -d "$PROJECTS" ]] || mkdir -p "$PROJECTS"
pushd $PROJECTS >/dev/null
for project in sm/sm wayneeseguin/rvm railsinstaller/railsinstaller-nix
do
dir=${project#*/}
[[ -d $dir ]] ||
{
printf -- "-- preparing $dir :\n"
mkdir -p $dir
curl -L https://github.com/$project/archive/master.tar.gz | tar xz --strip-components=1 -C $dir
}
done
popd >/dev/null
__package=""
case $(sw_vers -productVersion) in
10.6.*) __package="GCC-10.6.pkg" ;;
10.7.*|10.8.*) __package="GCC-10.7-v2.pkg" ;;
esac
[[ -z "${__package:-}" ]] ||
{
sudo mkdir -p /opt/rix &&
sudo curl -kLC - https://github.com/downloads/kennethreitz/osx-gcc-installer/${__package} -o /opt/rix/${__package} &&
sudo installer -package /opt/rix/${__package} -target / ||
echo "Failed downloading/installing ${__package}"
}
printf -- "-- paths in /etc/rixrc :\n"
printf "\
export sm_local_path=$PROJECTS/sm\n\
export rvm_local_path=$PROJECTS/rvm\n\
export installbuilder_path=$BUILDER\n\
" | sudo tee /etc/rixrc