forked from sb2nov/mac-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (30 loc) · 928 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
.PHONY: ci deploy deps install lint serve
GITBOOK = $(shell command -v ./node_modules/.bin/gitbook 2> /dev/null)
LINTER = $(shell command -v ./node_modules/.bin/markdownlint 2> /dev/null)
YARN = $(shell command -v yarn 2> /dev/null)
# This is run on Travis to verify linting is OK and that the guide builds
ci: lint
$(GITBOOK) install && $(GITBOOK) build
# Deploy new version of the guide. Will update list of contributors
deploy:
sh ./scripts/publish_gitbook.sh
# Install dependencies
deps:
ifeq ($(YARN),)
$(error "yarn is not available, please install it")
else
$(YARN)
endif
# Install dependencies and gitbook
install: deps
$(GITBOOK) install
# Lint markdown files
lint:
@$(LINTER) . --ignore node_modules && echo 'All good 👌'
# Start a server that serves the guide locally
serve:
ifeq ($(GITBOOK),)
$(error "GitBook is not available, please run 'make install' first")
else
$(GITBOOK) serve
endif