dotfiles/Makefile

99 lines
4.9 KiB
Makefile
Raw Normal View History

2020-09-27 18:58:44 +00:00
SHELL := bash
.PHONY: Install
install: pre-reqs dotfiles ## Installs all dotfiles and associated.
.PHONY: pre-reqs
pre-reqs: ## Install all required binaries.
which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \
[ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \
brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \
brew list rust > /dev/null || brew install rust; \
2021-07-01 06:14:11 +00:00
which rustup > /dev/null || curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path; \
2020-09-27 18:58:44 +00:00
which fzf > /dev/null || brew install fzf; \
which bat > /dev/null || brew install bat; \
2020-10-13 13:18:12 +00:00
which curlie > /dev/null || brew install rs/tap/curlie; \
2020-09-27 18:58:44 +00:00
which exa > /dev/null || brew install exa; \
which kubectl > /dev/null || brew install kubectl; \
which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \
which k9s > /dev/null || brew install k9s; \
which helm > /dev/null || brew install helm; \
which go > /dev/null || brew install go; \
which jq > /dev/null || brew install jq; \
which kind > /dev/null || brew install kind; \
which kubectx > /dev/null || brew install kubectx; \
which tldr > /dev/null || brew install tldr; \
which progress > /dev/null || brew install progress; \
which htop > /dev/null || brew install htop; \
which starship > /dev/null || brew install starship; \
which macchina > /dev/null || cargo install macchina; \
which rg > /dev/null || brew install ripgrep; \
which delta > /dev/null || brew install git-delta; \
which dust > /dev/null || brew install dust; \
which duf > /dev/null || brew install duf; \
which fd > /dev/null || brew install fd; \
which bandwhich > /dev/null || brew install bandwhich; \
which btm > /dev/null || cargo install bottom; \
which procs > /dev/null || brew install procs; \
2021-07-19 06:33:55 +00:00
which dog > /dev/null || brew install dog; \
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions; \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting;
2020-09-27 18:58:44 +00:00
2020-12-07 06:39:28 +00:00
.PHONY: upgrade
upgrade: ## Upgrade all required binaries.
brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null && brew upgrade homebrew/cask-fonts/font-open-dyslexic-nerd-font; \
brew list rust > /dev/null || brew upgrade rust; \
2021-07-01 06:14:11 +00:00
which rustup > /dev/null || rustup update; \
2020-12-07 06:39:28 +00:00
which fzf > /dev/null && brew upgrade fzf; \
which bat > /dev/null && brew upgrade bat; \
which curlie > /dev/null && brew upgrade rs/tap/curlie; \
which exa > /dev/null && brew upgrade exa; \
which kubectl > /dev/null && brew upgrade kubectl; \
which tkn > /dev/null && brew upgrade tektoncd/tools/tektoncd-cli; \
which k9s > /dev/null && brew upgrade k9s; \
which helm > /dev/null && brew upgrade helm; \
which go > /dev/null && brew upgrade go; \
which jq > /dev/null && brew upgrade jq; \
which kind > /dev/null && brew upgrade kind; \
which kubectx > /dev/null && brew upgrade kubectx; \
which tldr > /dev/null && brew upgrade tldr; \
which progress > /dev/null && brew upgrade progress; \
which htop > /dev/null && brew upgrade htop; \
which starship > /dev/null && brew upgrade starship; \
which macchina > /dev/null && cargo install macchina; \
which rg > /dev/null && brew upgrade ripgrep; \
which delta > /dev/null && brew upgrade git-delta; \
which dust > /dev/null && brew upgrade dust; \
which duf > /dev/null && brew upgrade duf; \
which fd > /dev/null && brew upgrade fd; \
which bandwhich > /dev/null && brew upgrade bandwhich; \
which btm > /dev/null && cargo install bottom; \
which procs > /dev/null && brew upgrade procs; \
2021-07-19 06:33:55 +00:00
which dog > /dev/null && brew upgrade dog; \
cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && git pull && cd -; \
cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git pull && cd -;
2020-12-07 06:39:28 +00:00
2020-09-27 18:58:44 +00:00
.PHONY: dotfiles
dotfiles: ## Installs the dotfiles.
2021-05-16 11:01:32 +00:00
@GITEMAIL=$$(git config --get user.email); \
2021-05-14 04:38:41 +00:00
for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".k9s" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \
2020-09-27 18:58:44 +00:00
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/$$f; \
done; \
2020-12-07 07:07:54 +00:00
git config --system --add user.email $$GITEMAIL; \
2020-10-03 07:27:31 +00:00
mkdir -p $(HOME)/.additional_dotfiles; touch $(HOME)/.additional_dotfiles/credentials; \
mkdir -p $(HOME)/.config; \
2020-09-27 18:58:44 +00:00
for file in $(shell find $(CURDIR)/.config -type f); do \
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/.config/$$f; \
2021-05-14 04:38:41 +00:00
done; \
mkdir -p $(HOME)/.k9s; \
for file in $(shell find $(CURDIR)/.k9s -type f); do \
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/.k9s/$$f; \
done; \
2020-09-27 18:58:44 +00:00
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'