Skip to content

Commit

Permalink
Edit Makfile
Browse files Browse the repository at this point in the history
- fix wildcard .env test
- reset some settings to their defaults, .env overrides
- USE_CACHE when DENO_DIR is defined
  • Loading branch information
matt-mcmahon committed Nov 14, 2020
1 parent 048b8c4 commit ba493de
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,40 @@
# Include, then immediately export, environment variables in .env file.
# These variables will be available to the Deno CLI.
ifneq ($(wildcard ".env"),)
ifneq ($(wildcard .env),)
include .env
endif

export


# These settings can be safely disabled by setting the VARIABLE_NAME to nothing
# in your deployment's .env file. For template, setting the following would
# disable the local Deno cache in favor of Deno's global cache:
# in your deployment's .env file. For template, setting DENO_DIR as the below
# will project's local Deno cache in favor of Deno's global cache. If you delete
# the `DENO_DIR=` line instead, the .env file would NOT disable the cache, and
# instead use the default value, `.deno`.
#
# DENO_DIR=
#
DENO_BUNDLE_FILE ?= fluentty.js
DENO_BUNDLE_FILE ?= bundle.js
DENO_DEPENDENCIES_FILE ?= dependencies.ts
DENO_DIR ?= .deno
DENO_MAIN ?= module.ts
DENO_SOURCE_DIR ?= source
REMOTE_DIRS ?= remote
IMPORT_MAP ?= import_map.json
LOCK_FILE ?= lock_file.json
NPM ?= npm
RUN_PERMISSIONS ?=
TEST_PERMISSIONS ?= --allow-run --allow-read --allow-write
USE_CACHE ?= --cached-only
USE_UNSTABLE ?= --unstable
TEST_PERMISSIONS ?=
USE_UNSTABLE ?=

# The default values for these settings are meant to be easily overwritten by
# your project's .env file.
#
# Do NOT set these values to nothing.
#
# Not directly configurable:
DENO_DIR_ABS := $(PWD)/$(DENO_DIR)

GEN_DIR ?= /dev/null

REMOTE_DIRS := remote

GEN_DIR := /dev/null
OPTIONAL_EXTENSIONS := (\.d.ts)|(\.ts)|(\.js)
PRODUCTION_FILES := $(shell find "$(DENO_SOURCE_DIR)" -type f -name "*.ts" -not -name "*.test.ts")
REMOTE_DEPENDENCIES := $(shell find "$(REMOTE_DIRS)" -type f -name "*.ts")
SOURCE_FILES := $(shell find "$(DENO_SOURCE_DIR)" -type f -name "*.ts")

OPTIONAL_EXTENSIONS := (\.d.ts)|(\.ts)|(\.js)

ifneq ($(wildcard $(IMPORT_MAP)),)
IMPORT_MAP_OPTIONS := --importmap $(IMPORT_MAP)
USE_UNSTABLE := --unstable
Expand All @@ -51,6 +43,12 @@ undefine IMPORT_MAP
undefine IMPORT_MAP_OPTIONS
endif

ifneq ($(DENO_DIR),)
USE_CACHE ?= --cached-only
else
USE_CACHE ?=
endif

ifneq ($(LOCK_FILE),)
LOCK_OPTIONS := --lock $(LOCK_FILE)
LOCK_OPTIONS_WRITE := --lock $(LOCK_FILE) --lock-write
Expand Down

0 comments on commit ba493de

Please sign in to comment.