Last active
April 1, 2018 22:49
-
-
Save robatron/4ccea1ba5324ab8730996937d25aaf7b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# Remote script to install these dotfiles on a system | |
system_type=$(uname -s) | |
repo_url="https://[email protected]/robatron/dotfiles.git" | |
echo "Verifying git installed..." | |
if ! [ -x "$(command -v git)" ]; then | |
echo "Git not installed. Attempting to install..." | |
if [ "$system_type" = "Darwin" ]; then | |
echo "Mac OS X detected. Looking for brew..." | |
if ! [ -x "$(command -v brew)" ]; then | |
echo "Homebrew missing. Installing homebrew..." | |
/usr/bin/ruby -e \ | |
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
echo "Installing git via brew..." | |
brew install git | |
elif [ "$system_type" = "Linux" ]; then | |
echo "Linux detected. Looking for apt..." | |
if ! [ -x "$(command -v apt)" ]; then | |
echo "Installing git via apt..." | |
sudo apt install git | |
else | |
echo "Can't install git via apt and I don't know what to do :-(" | |
exit 1 | |
fi | |
fi | |
fi | |
echo "Installing yadm via git..." | |
mkdir -p ~/bin ~/opt | |
git clone https://github.com/TheLocehiliosan/yadm.git ~/opt/yadm | |
ln -sf ~/opt/yadm/yadm ~/bin/ | |
export PATH="~/bin:$PATH" | |
echo "Cloning dotfiles..." | |
yadm clone $repo_url | |
yadm status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment