-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Makefile
63 lines (53 loc) · 2.02 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
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash
VERSION := `node -pe "require('./package.json').version"`
ENV ?= production
NODE_MODULES_DIR ?= ../node_modules
NODE_OPTIONS="--max-old-space-size=4096"
all : info clean dependencies bot
.PHONY : all
info:
@echo -ne "\n\t ----- Build ENV: $(ENV)"
@echo -ne "\n\t ----- Build commit\n\n"
@git log --oneline -3 | cat
dependencies:
@echo -ne "\n\t ----- Cleaning up dependencies\n"
@rm -rf node_modules
@rm -rf ${NODE_MODULES_DIR}
@echo -ne "\n\t ----- Installation of dependencies\n"
npm install --include=dev
@echo -ne "\n\t ----- Installation of husky\n"
npx --yes husky install
eslint:
@echo -ne "\n\t ----- Checking eslint\n"
NODE_OPTIONS="--max-old-space-size=4096" npx eslint --ext .ts src --quiet
jsonlint:
@echo -ne "\n\t ----- Checking jsonlint\n"
for a in $$(find ./locales -type f -iname "*.json" -print); do /bin/false; jsonlint $$a -q; done
bot:
@rm -rf dest
@echo -ne "\n\t ----- Fetching rates\n"
node tools/fetchRates.js
ifeq ($(ENV),production)
@echo -ne "\n\t ----- Building bot (strip comments)\n"
@npx tsc --removeComments true
else
@echo -ne "\n\t ----- Building bot\n"
@npx tsc --removeComments false
endif
@npx tsc-alias
pack-modules:
@echo -ne "\n\t ----- Packing into node_modules-$(VERSION).zip\n"
@npx --yes bestzip node_modules-$(VERSION).zip node_modules
pack:
@echo -ne "\n\t ----- Packing into sogeBot-$(VERSION).zip\n"
@cp ./src/data/.env* ./
@cp ./src/data/.env.sqlite ./.env
@npx --yes bestzip sogeBot-$(VERSION).zip .commit .npmrc .env* package-lock.json patches/ dest/ locales/ LICENSE package.json docs/ AUTHORS tools/ bin/ bat/ fonts.json assets/ favicon.ico
prepare:
@echo -ne "\n\t ----- Cleaning up node_modules\n"
@rm -rf node_modules
clean:
@echo -ne "\n\t ----- Cleaning up compiled files\n"
@rm -rf public/dist/bootstrap* public/dist/carousel/* public/dist/gallery/* public/dist/jquery public/dist/lodash public/dist/velocity-animate public/dist/popper.js public/dist/flv.js
@rm -rf dest