forked from GoogleCloudPlatform/nodejs-docs-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 743 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Makefile for running typical developer workflow actions.
# To run actions in a subdirectory of the repo:
# make lint build dir=translate/snippets
INTERFACE_ACTIONS="build test lint"
.ONESHELL: #ease subdirectory work by using the same subshell for all commands
.-PHONY: *
# Default to current dir if not specified.
dir ?= $(shell pwd)
export GOOGLE_CLOUD_PROJECT = ${GOOGLE_SAMPLES_PROJECT}
build:
npm install
cd ${dir}
npm install
npm run build --if-present
test: check-env build
cd ${dir}
npm test
lint:
cd ${dir}
npx gts fix
npx gts lint
check-env:
ifndef GOOGLE_SAMPLES_PROJECT
$(error GOOGLE_SAMPLES_PROJECT environment variable is required to perform this action)
endif
list-actions:
@ echo ${INTERFACE_ACTIONS}