-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall
More file actions
executable file
·63 lines (47 loc) · 1.28 KB
/
install
File metadata and controls
executable file
·63 lines (47 loc) · 1.28 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
#!/bin/sh
PREFIX="/usr/local"
set -e
# Cleanup previous install
if [ -d build ]; then
rm -r build
fi
# Validate
if [ "$(whoami)" != "root" ]; then
echo "ERROR: You need to run this as root. (try: sudo ./install)"
exit 1
fi
echo "Checking system..."
if [ "$(uname)" != "Darwin" ]; then
echo "\nERROR: CodeSync only works on Mac OS X platforms."
exit 1
fi
if [ "$(which ruby)" == "" ]; then
echo "\nERROR: CodeSync requires ruby: http://www.ruby-lang.org/en/"
exit 1
fi
LIB_DIR=$(ruby -e 'print $:.first')
echo $LIB_DIR
if [[ "$LIB_DIR" == "nil" || "$LIB_DIR" == "" ]]; then
echo "ERROR: Could not determine Ruby's library directory. Reinstall Ruby and try again. http://www.ruby-lang.org/en/"
exit 1
fi
# Check to see if rb-fsevent gem exits, if it does not install it
# rb-fsevent needed to fix a bug with OS X Lion
if [ "$(gem list -i rb-fsevent)" == "false" ]; then
echo "CodeSync requires rb-fsevent. It appears that this gem is not installed. Don't worry we'll take care of that for you!"
gem install rb-fsevent
fi
echo "Done\n"
echo "Installing..."
cp -v bin/codeSync $PREFIX/bin
if [ $? -ne 0 ]; then
echo "\nInstall Failed"
exit 1
fi
chmod 755 $PREFIX/bin/codeSync
if [ $? -ne 0 ]; then
echo "\nInstall Failed"
exit 1
fi
# Done
echo "\nInstall Complete"