Created
June 28, 2016 12:35
-
-
Save onlurking/b8b0f528a76fea11496af52be01fac91 to your computer and use it in GitHub Desktop.
DevEnv Shellscript - Draft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function exists { hash $1 2>/dev/null; } | |
function !exists { hash $1 >/dev/null 2>&1; } | |
function elevate{ | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
} | |
function quit { | |
unset -f exists; | |
unset -f !exists; | |
} | |
function install_rvm{ | |
gpg --keyserver hkp://keys.gnupg.net \ | |
--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3; | |
curl -sSL https://get.rvm.io | \ | |
bash -s stable --ruby --auto-dotfiles; | |
} | |
function install_docker | |
{ | |
usermod -a -G docker $(whoami); | |
} | |
if exists pacman; then | |
!exists git || { pacman -S --noconfirm git; } | |
!exists zsh || { pacman -S --noconfirm zsh; } | |
!exists pip2 || { pacman -S --noconfirm python2-pip; } | |
!exists pip || { pacman -S --noconfirm python-pip; } | |
!exists htop || { pacman -S --noconfirm htop; } | |
elif exists apt-get; then | |
apt-get update && apt-get upgrade -y; | |
!exists git || { apt-get install -y git; } | |
!exists zsh || { apt-get install -y zsh; } | |
!exists pip || { apt-get install -y pip; } | |
elif exists brew; then | |
!exists git || { brew install git; } | |
!exists zsh || { brew install zsh; } | |
!exists pip || { brew install python; } | |
else | |
echo "No." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment