Skip to content

Commit

Permalink
macOS requires the template to be at the end (prometheus#971)
Browse files Browse the repository at this point in the history
* macOS requires the template to be at the end

* Update makefile to use .js extension

* see if this works..
  • Loading branch information
stuartnelson3 authored and Corentin Chary committed Sep 14, 2017
1 parent fd6452d commit aef10dd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ui/app/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
ELM_FILES := $(shell find src -iname *.elm)
DOCKER_IMG :=elm-env
DOCKER_CMD := docker run --rm -t -v $(PWD):/app -w /app $(DOCKER_IMG)
TEMPFILE := $(shell mktemp ./elm-XXXXXXXXXX.js)
# macOS requires mktemp template to be at the end of the filename.
TEMPFILE := $(shell mktemp ./elm-XXXXXXXXXX)
# --output flag for elm make must end in .js or .html.
TEMPFILE_JS := "$(TEMPFILE).js"

ifeq ($(NO_DOCKER), true)
DOCKER_CMD=
Expand All @@ -28,9 +31,9 @@ dev-server:

script.js: elm-env format $(ELM_FILES)
@echo ">> building script.js"
@$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE)
@$(DOCKER_CMD) uglifyjs $(TEMPFILE) --compress unused --mangle --output $(@)
@rm $(TEMPFILE)
@$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE_JS)
@$(DOCKER_CMD) uglifyjs $(TEMPFILE_JS) --compress unused --mangle --output $(@)
@rm -rf $(TEMPFILE_JS) $(TEMPFILE)

clean:
- @rm script.js
Expand Down

0 comments on commit aef10dd

Please sign in to comment.