Permalink
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 f9da8e3 commit bcf19e6e703b5dfee2905ccabe944c91a61643d7 @msantos committed Oct 8, 2010
Showing with 10 additions and 8 deletions.
  1. +0 −6 Emakefile
  2. +10 −2 Makefile
  3. BIN rebar
View
@@ -1,6 +0,0 @@
-{["src/*"],
- [{i, "include"},
- {outdir, "ebin"},
- debug_info]
-}.
-
View
@@ -1,9 +1,17 @@
REBAR=$(shell which rebar || echo ./rebar)
-compile:
+all: 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
View
Binary file not shown.

0 comments on commit bcf19e6

Please sign in to comment.