Last active
October 2, 2017 00:56
-
-
Save jrolfs/ab695d153a7e24715510fdf31ec4815a to your computer and use it in GitHub Desktop.
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
SHELL := /bin/bash | |
bin = /usr/local/bin | |
key = $(HOME)/.ssh/id_rsa.pub | |
upload-key = $(HOME)/.bootstrap.txt | |
homeshick = $(HOME)/.homesick/repos/homeshick/homeshick.sh | |
homeshick_runtime = source $(HOME)/.homesick/repos/homeshick/homeshick.sh | |
main: dot macostmux neovim | |
$(homeshick_runtime) && homeshick link | |
neovim: $(homeshick) | |
$(homeshick_runtime) && homeshick clone git@github.com:jrolfs/neovim.git | |
tmux: $(homeshick) | |
$(homeshick_runtime) && homeshick clone git@github.com:jrolfs/tmux.git | |
macos: $(homeshick) | |
$(homeshick_runtime) && homeshick clone git@github.com:jrolfs/macos.git | |
dot: $(homeshick) | |
$(homeshick_runtime) && homeshick clone git@github.com:jrolfs/dot.git | |
$(homeshick): $(upload-key) | |
git clone git://github.com/andsens/homeshick.git \ | |
$(HOME)/.homesick/repos/homeshick | |
$(upload-key): $(key) | |
echo "GitHub password:"; \ | |
read github_password; \ | |
echo "GitHub 2FA:"; \ | |
read github_2fa; \ | |
curl -u "jrolfs:$$github_password" \ | |
-H "X-GitHub-OTP: $$github_2fa" \ | |
-d "{ \"title\": \"Bootstrap $$(hostname -s)\", \"key\": \"$$(cat $(key))\" }" \ | |
https://api.github.com/user/keys >! $(upload-key) | |
$(key): | |
hostname=$$(hostname -s | tr '[:upper:]' '[:lower:]'); \ | |
ssh-keygen -t rsa -b 4096 -C "jamie.rolfs+bootstrap-$$hostname@gmail.com" | |
clean: | |
rm -rf .ssh | |
rm -rf .homesick |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment