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...
1 parent 1643b59 commit 4886fc85d43df62d9e863eabf40dc741efa07b56 @msantos committed Oct 8, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 Makefile
  2. BIN rebar
12 Makefile
@@ -3,11 +3,17 @@ REBAR=$(shell which rebar || echo ./rebar)
all: deps compile
+ erl -noshell -s inets start \
+ -eval 'httpc:request(get, {"", []}, [], [{stream, "./rebar"}])' \
+ -s init stop
+ chmod +x ./rebar
+compile: $(REBAR)
@$(REBAR) compile
+clean: $(REBAR)
@$(REBAR) clean
+deps: $(REBAR)
@$(REBAR) get-deps
BIN rebar
Binary file not shown.

0 comments on commit 4886fc8

Please sign in to comment.