Last active
June 29, 2019 04:07
-
-
Save jsatk/8bb03a96dda00ce7a85089da01e05d89 to your computer and use it in GitHub Desktop.
Small part of my makefile that is bad.
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
# asdf --------------------------------------------------------------------- {{{ | |
# TODO: This is horrible. Do this in a loop and stash the results of `asdf | |
# plugin-list` so you only have to call it once. | |
node_installed := $(shell [[ "$(shell asdf plugin-list)" == *nodejs* ]] && echo 0 || echo 1) | |
ruby_installed := $(shell [[ "$(shell asdf plugin-list)" == *ruby* ]] && echo 0 || echo 1) | |
golang_installed := $(shell [[ "$(shell asdf plugin-list)" == *golang* ]] && echo 0 || echo 1) | |
rust_installed := $(shell [[ "$(shell asdf plugin-list)" == *rust* ]] && echo 0 || echo 1) | |
python_installed := $(shell [[ "$(shell asdf plugin-list)" == *python* ]] && echo 0 || echo 1) | |
.PHONY: asdf | |
asdf: | ## Install specific verions of languages -- language versions specified in ~/.tool-versions. | |
ifeq ($(node_installed), 1) | |
asdf plugin-add nodejs | |
endif | |
ifeq ($(ruby_installed), 1) | |
asdf plugin-add ruby | |
endif | |
ifeq ($(golang_installed), 1) | |
asdf plugin-add golang | |
endif | |
ifeq ($(rust_installed), 1) | |
asdf plugin-add rust | |
endif | |
ifeq ($(python_installed), 1) | |
asdf plugin-add python | |
endif | |
asdf install | |
# }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment