Skip to content

Commit

Permalink
Generate .env if one does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Friend committed Oct 14, 2015
1 parent a812c41 commit 0bf5ce8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ target/

# SQLite databases
*.db

# Procfile runner config file
.env
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ PYLINT := $(BIN)/pylint
PYTEST := "$(BIN)/py.test"
COVERAGE := $(BIN)/coverage
ACTIVATE := $(BIN)/activate
HONCHO := . $(ACTIVATE); $(BIN)/honcho

HONCHO_CONFIG := .env

# Flags for PHONY targets
DEPENDS := $(ENV)/depends
Expand Down Expand Up @@ -113,9 +116,18 @@ tests: depends

# Development server #########################################################

define HONCHO_CONFIG_CONTENTS
GUNICORN_RELOAD=true
GUNICORN_WORKER_CLASS=gevent
endef

export HONCHO_CONFIG_CONTENTS
$(HONCHO_CONFIG):
echo "$$HONCHO_CONFIG_CONTENTS" > $@

.PHONY: serve
serve: depends
. $(ACTIVATE); $(BIN)/honcho start
serve: depends $(HONCHO_CONFIG)
$(HONCHO) start -e $(HONCHO_CONFIG)

# Database Migrations ########################################################

Expand Down

0 comments on commit 0bf5ce8

Please sign in to comment.