Skip to content

Instantly share code, notes, and snippets.

@jsatk
Last active June 29, 2019 04:07
Show Gist options
  • Select an option

  • Save jsatk/8bb03a96dda00ce7a85089da01e05d89 to your computer and use it in GitHub Desktop.

Select an option

Save jsatk/8bb03a96dda00ce7a85089da01e05d89 to your computer and use it in GitHub Desktop.

Revisions

  1. jsatk revised this gist Jun 29, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # asdf --------------------------------------------------------------------- {{{

    # TODO: This is horrible. Do this in a loop and stash the rsults of `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)
  2. jsatk renamed this gist Jun 29, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. jsatk created this gist Jun 29, 2019.
    30 changes: 30 additions & 0 deletions part-of-makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # asdf --------------------------------------------------------------------- {{{

    # TODO: This is horrible. Do this in a loop and stash the rsults 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

    # }}}