-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
76 lines (60 loc) · 1.69 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.DEFAULT_GOAL := help
CLASP = npx @google/clasp
PROJECT_NAME := $(shell basename "$(CURDIR)")
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.clasp.json:
make login
$(CLASP) create --title $(PROJECT_NAME) --type webapp --rootDir ./src
mv src/.clasp.json .
$(CLASP) setting fileExtension ts
# $(CLASP) setting filePushOrder
sed -i -e 's/}/,"filePushOrder":["src\/OAuth2Handler.ts","src\/SlackBaseHandler.ts","src\/BaseError.ts","src\/WorksClient.ts"]}/' .clasp.json
rm -f .clasp.json-e
node_modules:
npm ci
.PHONY: login
login: ## Google login
login:
$(CLASP) login
.PHONY: push
push: ## Push Google apps scripts
push: .clasp.json lint
$(CLASP) push -f
.PHONY: deploy
deploy: ## Deploy Google apps scripts
deploy: .clasp.json
$(CLASP) deploy -d "`npx -c 'echo \"$$npm_package_version\"'`"
.PHONY: redeploy
redeploy: ## Re-Deploy Google apps scripts
redeploy: .clasp.json
$(CLASP) deploy --versionNumber `$(CLASP) versions | grep -o '^[0-9]*' | tail -n 1` -d "`npx -c 'echo \"$$npm_package_version\"'`"
.PHONY: open
open: ## Open Google apps scripts
open: .clasp.json
$(CLASP) open
.PHONY: application
application: ## Open web application
application: .clasp.json
$(CLASP) open --webapp
.PHONY: pull
pull: ## Pull Google apps scripts
pull: .clasp.json
$(CLASP) pull
.PHONY: lint
lint: ## Run tslint
lint: node_modules
npm run lint
.PHONY: test
test: ## Run jest
test: node_modules
npm test
.PHONY: undeploy
undeploy: ## all undeploy Google apps scripts
undeploy:
$(CLASP) undeploy --all
.PHONY: npm-check-updates
npm-check-updates: ## npm check updates
npm-check-updates:
npx npm-check-updates -u