Skip to content

Commit

Permalink
Use /usr/local/bin as default install location
Browse files Browse the repository at this point in the history
  • Loading branch information
dizzyd committed Jul 6, 2011
1 parent 1967686 commit 7c8b92a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rebar.mk
Expand Up @@ -5,21 +5,29 @@ REBAR_GLOBAL ?= $(shell which rebar)
REBAR_LOCAL ?= $(shell which ./rebar)
REBAR_TARGET ?= $(dir $(shell which escript))

# Check for local rebar (./rebar), then globally installed and default to
# /usr/local/bin/rebar
ifneq ($(strip $(REBAR_LOCAL)), )
REBAR ?= $(REBAR_LOCAL)
else ifneq ($(strip $(REBAR_GLOBAL)), )
REBAR ?= $(REBAR_GLOBAL)
else
REBAR ?= rebar
REBAR ?= /usr/local/bin/rebar
$(warning Rebar not installed or available. Try 'make rebar-info')
endif

# Try to use wget and fall back to curl
ifneq ($(strip $(shell which wget)), )
REBAR_FETCH ?= wget --no-check-certificate -q -O - $(REBAR_URL)
else
REBAR_FETCH ?= curl -s -f $(REBAR_URL)
endif

# Check for missing/empty REBAR_TARGET; fallback to /usr/local/bin in that
# situation
ifeq ($(strip $(REBAR_TARGET)),)
REBAR_TARGET = /usr/local/bin
endif

rebar-info:
@echo "Rebar needs to be either on your path or present in the current" \
Expand Down

1 comment on commit 7c8b92a

@Vagabond
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue I reported.

Please sign in to comment.