fix shellchecks warnings + stop using brew in Linux

This commit is contained in:
MorganGeek 2019-12-01 17:21:08 +01:00
parent 3cb2d2c8b3
commit b93ff20054
4 changed files with 94 additions and 33 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
cask "java"
cask "iterm2"
#cask "iterm2"
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
yum -y install https://zoom.us/client/latest/zoom_x86_64.rpm
@ -38,10 +37,10 @@ yum -y install firefox
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
cd fonts || exit
./install.sh
# clean-up a bit
cd ..
cd .. || exit
rm -rf fonts
# Install ZSH
@ -58,11 +57,11 @@ echo "export PATH=\"$GOPATH/bin:$PATH\"" >> ~/.zshrc
# Install Hugo
mkdir "$HOME/src"
cd "$HOME/src"
cd "$HOME/src" || exit
git clone https://github.com/gohugoio/hugo.git
cd hugo
cd hugo || exit
go install --tags extended
cd "$HOME"
cd "$HOME" || exit
# Inet utils
yum -y install telnet ftp rsh traceroute
@ -194,7 +193,7 @@ yum -y install nmon glances
# Install Fuzzy finder
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
yes | ~/.fzf/install
exec "$SHELL"
#exec "$SHELL"
# Install diff-so-fancy
curl https://raw.githubusercontent.com/so-fancy/diff-so-fancy/master/third_party/build_fatpack/diff-so-fancy > /usr/local/bin/diff-so-fancy && chmod +x /usr/local/bin/diff-so-fancy
@ -218,3 +217,50 @@ yum -y install aspell aspell-en
curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo
# Install neofetch to display system info nicely
yum -y install neofetch
cargo install nu
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
yum install -y kubectl
# Install the harbottle-main repo
sudo yum -y install https://harbottle.gitlab.io/harbottle-main/7/x86_64/harbottle-main-release.rpm
yum -y install kubectx
# Install packer
packer_version=1.4.5
curl -L -o /tmp/packer.zip https://releases.hashicorp.com/packer/${packer_version}/packer_${packer_version}_linux_amd64.zip
cd /usr/local/bin && unzip -o /tmp/packer.zip && rm -f /tmp/packer.zip
yum -y install weechat tflint
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.35.0/ktlint && chmod a+x ktlint
# you can also download ktlint manually from https://github.com/pinterest/ktlint/releases
# another option is "brew install ktlint"
# verify PGP signature (optional but recommended)
curl -sS https://keybase.io/pinterestandroid/pgp_keys.asc | gpg --import
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.35.0/ktlint.asc
gpg --verify ktlint.asc
git clone https://github.com/getzola/zola.git
cd zola
cargo build --Release
yum install -y https://github.com/vmware/octant/releases/download/v0.9.1/octant_0.9.1_Linux-64bit.rpm && yum clean all
yum -y install bc
git clone https://github.com/fcambus/ansiweather.git
git clone https://github.com/datawire/telepresence.git && cd telepresence
env PREFIX=/usr/local ./install.sh

View File

@ -3,7 +3,7 @@
echo "Hello $(whoami)! Let's get you set up."
echo "mkdir -p $(HOME)/Code"
echo "mkdir -p $HOME/Code"
mkdir -p ~/Code
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
chmod +x ~/.scripts/*.sh
@ -23,28 +23,15 @@ case "$(uname -s)" in
Darwin)
echo "(Mac OS X) installing homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
;;
Linux)
echo "(Linux) installing homebrew"
git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew
mkdir -p ~/.linuxbrew/bin
ln -snf ../Homebrew/bin/brew ~/.linuxbrew/bin
eval "$(~/.linuxbrew/bin/brew shellenv)"
;;
*)
echo 'Homebrew installation aborted : Non supported OS'
exit
# Prevent `Error: Your Homebrew is outdated. Please run `brew update`.`
echo "Updating Homebrew"
brew update
;;
esac
# Prevent `Error: Your Homebrew is outdated. Please run `brew update`.`
echo "Updating Homebrew"
brew update
# Create symbolic links
echo "Creating symbolic links"
ln -snf ~/.local/share/chezmoi/ ~/dotfiles
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
ln -snf ~/Code/dotfiles/Gemfile ~/Gemfile
ln -snf ~/Code/dotfiles/README.md ~/README.md
ln -snf ~/Code/dotfiles/dot_bash_profile ~/.bash_profile
@ -75,8 +62,21 @@ case "$(uname -s)" in
esac
# Install dependencies (apps, fonts, ...) with Brew
echo "Brew installing stuff (apps, fonts, ...)"
brew bundle
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
brew bundle
;;
esac
# Install dependencies (apps, fonts, ...) for CentOS
case "$(uname -s)" in
Linux)
echo "(CentOS) Installing stuff (apps, ...)"
~/Code/dotfiles/centos.sh
;;
esac
# Switch to ZSH
echo "switching to ZSH"
@ -125,7 +125,7 @@ ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
echo "Installing Vundle + VIM Plugins"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
vim +PluginInstall +qall > /dev/null
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
cd "$HOME/.vim/bundle/YouCompleteMe" || exit
./install.py --all

View File

@ -4,7 +4,15 @@ export SDKMAN_DIR="$HOME/.sdkman"
chmod +x ~/.scripts/*.sh
source ~/.zshrc
sdk use java 8.0.222-zulu
brew bundle
# Homebrew reloading stuff
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Homebrew reloading stuff"
brew bundle
;;
esac
# OSX Defaults
case "$(uname -s)" in
Darwin)

View File

@ -2,9 +2,16 @@
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"
sdk selfupdate
brew update
#brew upgrade
brew outdated | xargs brew upgrade
# Upgrading HomeBrew stuff
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Homebrew upgrading stuff"
brew update
#brew upgrade
brew outdated | xargs brew upgrade
;;
esac
bundle update --all
#gem update --system
@ -15,5 +22,5 @@ sudo pip3 install --upgrade pip 2>/dev/null
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
pip freeze > ~/requirements.txt
# Update VIM plugins installed via Vundle https://github.com/VundleVim/Vundle.vim
vim +PluginUpdate +qall
vim +PluginUpdate +qall > /dev/null
rustup-update