-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·120 lines (93 loc) · 3.76 KB
/
Copy pathinstall
File metadata and controls
executable file
·120 lines (93 loc) · 3.76 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env bash
clear
# if [[ $OS == "Darwin" ]]; then
# # Add future support for installing dependencies
# elif [[ $OS == "Linux" ]] && [[ ! -z $(command -v lsb_release) ]]; then
# # Add future support for installing dependencies
# sudo apt-get install build-essential procps curl file git
# fi
OS=$(uname -s)
# include my library helpers for colorized echo and require_brew, etc
source ./lib_sh/echos.sh
bot "I will be making you cool :)"
#####
# install homebrew (CLI Packages)
#####
bot "Installing Packages"
# Check for internet connection before continuing
if ! curl -s --head https://www.google.com/ | grep -E "HTTP/2 200|HTTP/1.1 200" > /dev/null; then
error "No internet connection. Please check your network settings."
exit 1
fi
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | bash
if [[ $OS == "Darwin" ]]; then
curl -fsSL -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash
# Run commands for macOS:
export PATH=/opt/homebrew/bin:$PATH
elif [[ $OS == "Linux" ]] && [[ ! -z $(command -v lsb_release) ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if [[ $OS == "Darwin" ]]; then
# before continuing, check to see if the user has the necessary dependencies
bot "Checking for Homebrew and dependencies..."
if ! type "brew" > /dev/null; then
error "I depend on Homebrew to install packages."
error "Please validate that it has been installed and run script again."
exit 1
fi
brew doctor
brew upgrade
# Run commands for macOS:
brew install wget tmux gawk jq tldr ncdu tfenv azure-cli pyenv nvm telnet k9s awscli
brew install --cask iterm2 istat-menus jetbrains-toolbox docker diffmerge alfred skitch
elif [[ $OS == "Linux" ]] && [[ ! -z $(command -v lsb_release) ]]; then
DISTRO=$(lsb_release -is)
if [ $DISTRO == "Ubuntu" ] || [ $DISTRO == "Debian" ] ; then
# Run commands for Ubuntu:
sudo apt-get update -y
sudo apt-get install -y dnsutils unzip jq ffmpeg lsof
# brew install tmux gawk jq tldr ncdu tfenv azure-cli pyenv nvm k9s awscli
sudo apt-get update -y; sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install -y docker-ce
source ./ubuntu/kubectl.sh
source ./ubuntu/k9s.sh
source ./ubuntu/tfenv.sh
source ./ubuntu/az-cli.sh
if ! type pyenv > /dev/null 2>&1; then
# the command doesn't exist, so install it
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
fi
if ! type nvm > /dev/null 2>&1; then
# the command doesn't exist, so install it
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
fi
fi
fi
bot "creating symlinks for project dotfiles..."
pushd homedir > /dev/null 2>&1
now=$(date +"%Y.%m.%d.%H.%M.%S")
for file in .*; do
if [[ $file == "." || $file == ".." ]]; then
continue
fi
running "~/$file"
# if the file exists:
if [[ -e ~/$file ]]; then
mkdir -p ~/.dotfiles_backup/$now
mv ~/$file ~/.dotfiles_backup/$now/$file
echo "backup saved as ~/.dotfiles_backup/$now/$file"
fi
# symlink might still exist
unlink ~/$file > /dev/null 2>&1
# create the link
ln -s ~/.dotfiles/homedir/$file ~/$file
echo -en '\tlinked';ok
done
sudo chsh -s $(which zsh) $(whoami)
popd > /dev/null 2>&1