forked from baiyaaaaa/ubt-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (30 loc) · 1.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
help:
@echo "# common tasks"
@echo "$$ [35mmake[0m # help"
@echo "$$ [35mmake node_modules[0m # install dev dependencies"
@echo "$$ [35mmake build[0m # build only"
@echo "$$ [35mmake tag[0m # make a tag version"
@echo "$$ [35mmake test[0m # open test page"
@echo ""
node_modules: package.json
@npm install
build: node_modules
@npm run build
tests/bower_components: tests/bower.json
@cd tests && bower install
test: build tests/bower_components
@python -m SimpleHTTPServer 3153 > /dev/null 2>&1 &
@open http://127.0.0.1:3153/tests
tag:
@\
if [ $$(git status -s | wc -l) -gt 0 ]; then \
echo "请先打好 commit"; \
else \
git checkout $$(git rev-parse HEAD) 2>/dev/null; \
sed -i '' '/.*\.min\.js/d' .gitignore; \
make build; \
git add . -A; \
version=$$(cat bower.json | grep "version" | awk -F '"' '{print $$4}'); \
git commit -m $$version; \
git tag $$version -f; \
fi