-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·42 lines (30 loc) · 889 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
37
38
39
40
41
42
include .env
PROGRAM := npm
RM := rm -rf
MK := mkdir
CP := cp
ZIP := zip
ZIP_FOLDER := _v$(VERSION)
ENV_DEV := NODE_ENV=development
ENV_PROD := NODE_ENV=production
all: serve
build: clean transform prod
install:
$(PROGRAM) install
clean:
$(RM) dist
serve:
$(ENV_DEV) $(PROGRAM) run dev
prod:
$(ENV_PROD) $(PROGRAM) run prod
transform:
sed -i "" -r "s/version\":[ ]?\"[.0-9]*/version\"\: \"${VERSION}/g" "package.json"
sed -i "" -r "s/@[0-9]*\.[0-9]*\.[0-9]*\//@${VERSION}\//g" "README.md"
zip:
$(RM) $(ZIP_FOLDER)
$(MK) $(ZIP_FOLDER)
$(CP) dist/js-scroll-effect-module.js examples/index.html $(ZIP_FOLDER)/
$(CP) examples/scroll-effect-module.css examples/scroll-effect-module.css $(ZIP_FOLDER)/
sed -i "" "s/..\/dist\//.\//g" "$(ZIP_FOLDER)/index.html"
$(ZIP) $(ZIP_FOLDER)/$(SLUG)_v$(VERSION).zip -r $(ZIP_FOLDER)/*
.PHONY: all build serve clean prod zip install