-
Notifications
You must be signed in to change notification settings - Fork 57
/
brew.sh
executable file
·68 lines (55 loc) · 1.47 KB
/
brew.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
60
61
62
63
64
65
66
67
68
#!/bin/bash
echo ""
echo "This script is intended to setup CUDA and CUDNN"
echo "@author Andrew Hundt <[email protected]>"
echo ""
# source: https://gist.github.com/phatblat/1713458
# Save script's current directory
DIR=$(pwd)
# /bin/bash
set -e
set -u
set -x
sudo apt-get -y update
# minimal linuxbrew requirements
sudo apt-get install -y build-essential curl git python-setuptools ruby
#
# Check if Homebrew is installed
#
if ! [ -x "$(command -v brew)" ] ; then
OS=`uname`
case $OS in
'Linux')
OS='Linux'
alias ls='ls --color=auto'
curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/linuxbrew.sh | bash /dev/stdin
# Add brew path zshrc if it isn't already present
export PATH="$HOME/.linuxbrew/bin:$PATH"
#export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
#export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
FILE=~/.zshrc
grep -q "/.linuxbrew/bin" "$FILE" || echo "export PATH=\"\$HOME/.linuxbrew/bin:\$PATH\"" >> "$FILE"
#grep -q "$MANPATH" "$FILE" || echo "$MANPATH" >> "$FILE"
#grep -q "$INFOPATH" "$FILE" || echo "$INFOPATH" >> "$FILE"
;;
'FreeBSD')
OS='FreeBSD'
alias ls='ls -G'
;;
'WindowsNT')
OS='Windows'
;;
'Darwin')
OS='Mac'
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
;;
'SunOS')
OS='Solaris'
;;
'AIX') ;;
*) ;;
esac
else
brew update
fi
cd $DIR