Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS requires the template to be at the end #971

Merged
merged 3 commits into from
Sep 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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