Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Download rebar if script does not exist in path

Remove local copy of the rebar script. Preferentially use the user's
rebar script, if it exists in their path; otherwise, try to download it.

Since the download is in the clear, a future improvement would check a
hash before running the script.
  • Loading branch information...
commit 4886fc85d43df62d9e863eabf40dc741efa07b56 1 parent 1643b59
Michael Santos authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 Makefile
  2. BIN  rebar
12 Makefile
View
@@ -3,11 +3,17 @@ REBAR=$(shell which rebar || echo ./rebar)
all: deps compile
-compile:
+./rebar:
+ erl -noshell -s inets start \
+ -eval 'httpc:request(get, {"http://hg.basho.com/rebar/downloads/rebar", []}, [], [{stream, "./rebar"}])' \
+ -s init stop
+ chmod +x ./rebar
+
+compile: $(REBAR)
@$(REBAR) compile
-clean:
+clean: $(REBAR)
@$(REBAR) clean
-deps:
+deps: $(REBAR)
@$(REBAR) get-deps
BIN  rebar
View
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.