|
|
|
@ -3,50 +3,62 @@
|
|
|
|
|
|
|
|
|
|
echo "Hello $(whoami)! Let's get you set up."
|
|
|
|
|
|
|
|
|
|
echo "create vim directory is missing"
|
|
|
|
|
mkdir -vp "$HOME/.vim"
|
|
|
|
|
|
|
|
|
|
echo "mkdir -p $HOME/Code"
|
|
|
|
|
mkdir -p ~/Code
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_gitconfig ~/.gitconfig
|
|
|
|
|
chmod +x ~/.scripts/*.sh
|
|
|
|
|
|
|
|
|
|
if [[ $(uname) == "Linux" ]]; then
|
|
|
|
|
IS_LINUX=true
|
|
|
|
|
else
|
|
|
|
|
IS_LINUX=false
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ $(uname) == "Darwin" ]]; then
|
|
|
|
|
IS_MAC=true
|
|
|
|
|
else
|
|
|
|
|
IS_MAC=false
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Install missing package (Linux)
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Linux)
|
|
|
|
|
function installLinuxPackages() {
|
|
|
|
|
if [ "$IS_LINUX" = true ]; then
|
|
|
|
|
echo "(Linux) Installing Development Tools"
|
|
|
|
|
yum install sudo -y
|
|
|
|
|
sudo yum groupinstall 'Development Tools' -y
|
|
|
|
|
sudo yum install git which zip unzip ruby curl file docker gcc make libxcrypt-compat vim-enhanced -y
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install HomeBrew
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Darwin)
|
|
|
|
|
function installBrew() {
|
|
|
|
|
if [ "$IS_MAC" = true ]; then
|
|
|
|
|
echo "(Mac OS X) installing homebrew"
|
|
|
|
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
|
|
|
# Prevent `Error: Your Homebrew is outdated. Please run `brew update`.`
|
|
|
|
|
echo "Updating Homebrew"
|
|
|
|
|
brew update
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
# Path to ruby
|
|
|
|
|
export PATH="/usr/local/opt/ruby/bin:$PATH"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Create symbolic links
|
|
|
|
|
function createSymbolicLinks() {
|
|
|
|
|
echo "Creating symbolic links"
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_profile ~/.profile
|
|
|
|
|
ln -snf ~/.local/share/chezmoi/ ~/dotfiles
|
|
|
|
|
ln -snf ~/Code/dotfiles/Gemfile ~/Gemfile
|
|
|
|
|
ln -snf ~/Code/dotfiles/README.md ~/README.md
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_bash_profile ~/.bash_profile
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_gitconfig ~/.gitconfig
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_macos ~/.macos
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc
|
|
|
|
|
# custom linters
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters
|
|
|
|
|
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters # custom linters
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zsh_aliases ~/.zsh_aliases
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zsh_functions ~/.zsh_functions
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
|
|
|
|
@ -58,43 +70,44 @@ ln -snf ~/Code/dotfiles/private_dot_3llo/config.sh ~/.3llo_config
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template
|
|
|
|
|
|
|
|
|
|
# Other symblinks + Install Docker Desktop for Mac
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Darwin)
|
|
|
|
|
echo "(Mac OS X) Adding symbolic links"
|
|
|
|
|
ln -snf "$HOME/.config/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
|
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/Code/User/snippets" "$HOME/Library/Application Support/Code/User/snippets"
|
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.mackup.cfg" "$HOME/.mackup.cfg"
|
|
|
|
|
echo "(Mac OS X) Installing Docker"
|
|
|
|
|
~/.scripts/install_docker_for_mac.sh
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install dependencies (apps, fonts, ...) with Brew
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Darwin)
|
|
|
|
|
function installMacSoftware() {
|
|
|
|
|
if [ "$IS_MAC" = true ]; then
|
|
|
|
|
echo "(Mac OS X) Installing Docker"
|
|
|
|
|
~/.scripts/install_docker_for_mac.sh
|
|
|
|
|
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
|
|
|
|
|
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
|
|
|
|
|
brew bundle
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
# Configure Mac specific symbolic links
|
|
|
|
|
echo "(Mac OS X) Adding symbolic links"
|
|
|
|
|
mkdir -pv "$HOME/Library/Application Support/Code/User/snippets"
|
|
|
|
|
ln -snf "$HOME/.config/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
|
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/Code/User/snippets" "$HOME/Library/Application Support/Code/User/snippets"
|
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.mackup.cfg" "$HOME/.mackup.cfg"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install dependencies (apps, fonts, ...) for CentOS
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Linux)
|
|
|
|
|
function installLinuxSoftware() {
|
|
|
|
|
if [ "$IS_LINUX" = true ]; then
|
|
|
|
|
echo "(CentOS) Installing stuff (apps, ...)"
|
|
|
|
|
chmod +x ~/Code/dotfiles/centos.sh
|
|
|
|
|
~/Code/dotfiles/centos.sh
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Switch to ZSH
|
|
|
|
|
function switchToZsh() {
|
|
|
|
|
sudo -v
|
|
|
|
|
echo "switching to ZSH"
|
|
|
|
|
command -v zsh >>/etc/shells
|
|
|
|
|
chsh -s "$(command -v zsh)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Use SDKMan to install development tools
|
|
|
|
|
function installSDKMan() {
|
|
|
|
|
echo "Installing SDKMan as development tools manager"
|
|
|
|
|
curl -s "https://get.sdkman.io" | bash
|
|
|
|
|
|
|
|
|
@ -105,9 +118,9 @@ sdk install java 8.0.222-zulu
|
|
|
|
|
sdk install kotlin
|
|
|
|
|
echo "SDKMan updating"
|
|
|
|
|
sdk selfupdate
|
|
|
|
|
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Linux)
|
|
|
|
|
}
|
|
|
|
|
function installRubyOnLinux() {
|
|
|
|
|
if [ "$IS_LINUX" = true ]; then
|
|
|
|
|
echo '(Linux) Installing ruby'
|
|
|
|
|
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
|
|
|
|
|
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
|
|
|
|
@ -116,15 +129,18 @@ Linux)
|
|
|
|
|
rvm reload
|
|
|
|
|
rvm requirements run
|
|
|
|
|
rvm install 2.3.7
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install bundler for managing ruby dependencies and Gemfile
|
|
|
|
|
function installBundler() {
|
|
|
|
|
echo "Installing bundler for managing ruby dependencies and Gemfile"
|
|
|
|
|
sudo gem install bundler
|
|
|
|
|
bundle install
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install Oh My Zsh and some cool dependencies
|
|
|
|
|
function installOhMyZsh() {
|
|
|
|
|
echo "Installing Oh My Zsh + customizing themes and plugins"
|
|
|
|
|
echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>!
|
|
|
|
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
|
|
|
@ -133,49 +149,54 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/
|
|
|
|
|
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
|
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function installVimPlugins() {
|
|
|
|
|
echo "Installing Vundle + VIM Plugins"
|
|
|
|
|
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
|
|
|
|
vim +PluginInstall +qall >/dev/null
|
|
|
|
|
vim +'PluginInstall --sync' +qa >/dev/null
|
|
|
|
|
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
|
|
|
|
|
cd "$HOME/.vim/bundle/YouCompleteMe" || exit
|
|
|
|
|
./install.py --all
|
|
|
|
|
cd "$HOME" || exit
|
|
|
|
|
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
# Install no-more-secrets
|
|
|
|
|
function installNoMoreSecrets() {
|
|
|
|
|
echo "Installing no-more-secrets (for fun)"
|
|
|
|
|
git clone https://github.com/bartobri/no-more-secrets.git ~/Code/no-more-secrets
|
|
|
|
|
cd "$HOME/Code/no-more-secrets" || exit
|
|
|
|
|
make nms sneakers
|
|
|
|
|
sudo make install
|
|
|
|
|
cd "$HOME" || exit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# OSX Defaults
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Darwin)
|
|
|
|
|
function overrideMacOsDefaults() {
|
|
|
|
|
if [ "$IS_MAC" = true ]; then
|
|
|
|
|
echo "(Mac OS X) Loading preferences"
|
|
|
|
|
sudo sh .macos
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Customize /etc/hosts
|
|
|
|
|
function overrideEtcHosts() {
|
|
|
|
|
echo "Overriding /etc/hosts"
|
|
|
|
|
curl https://someonewhocares.org/hosts/hosts -o /etc/hosts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function installSoftware() {
|
|
|
|
|
# Install pip and pipenv
|
|
|
|
|
echo "Installing pip and pipenv"
|
|
|
|
|
sudo easy_install pip
|
|
|
|
|
sudo pip install --upgrade pip
|
|
|
|
|
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
|
|
|
|
sudo python3 get-pip.py
|
|
|
|
|
case "$(uname -s)" in
|
|
|
|
|
Darwin)
|
|
|
|
|
if [ "$IS_MAC" = true ]; then
|
|
|
|
|
echo "(Mac OS X) Updating PATH for loading pip user installed packages"
|
|
|
|
|
ln -snf /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/pip pip3
|
|
|
|
|
export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Upgrading pip"
|
|
|
|
|
sudo pip install --upgrade pip
|
|
|
|
|
echo "Pip installing stuff"
|
|
|
|
@ -226,12 +247,39 @@ go get -u -v github.com/camptocamp/terraboard
|
|
|
|
|
|
|
|
|
|
sudo curl -L git.io/scope -o /usr/local/bin/scope
|
|
|
|
|
sudo chmod a+x /usr/local/bin/scope
|
|
|
|
|
#scope launch
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Upgrade
|
|
|
|
|
function upgradeSoftware() {
|
|
|
|
|
echo "Upgrading apps"
|
|
|
|
|
~/.scripts/upgrade.sh
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Reload
|
|
|
|
|
function reloadConfig() {
|
|
|
|
|
echo "Reloading config"
|
|
|
|
|
~/.scripts/reload.sh
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function doIt() {
|
|
|
|
|
installLinuxPackages;
|
|
|
|
|
installBrew;
|
|
|
|
|
createSymbolicLinks;
|
|
|
|
|
installMacSoftware;
|
|
|
|
|
installLinuxSoftware;
|
|
|
|
|
switchToZsh;
|
|
|
|
|
installSDKMan;
|
|
|
|
|
installRubyOnLinux;
|
|
|
|
|
installBundler;
|
|
|
|
|
installOhMyZsh;
|
|
|
|
|
installVimPlugins;
|
|
|
|
|
installNoMoreSecrets;
|
|
|
|
|
overrideMacOsDefaults;
|
|
|
|
|
overrideEtcHosts;
|
|
|
|
|
installSoftware;
|
|
|
|
|
upgradeSoftware;
|
|
|
|
|
reloadConfig;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doIt;
|
|
|
|
|