-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
62 lines (45 loc) · 1.79 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
run:
make -f Makefile.server -j4 run
clean:
rm -rf _site
setup:
bundle check || bundle install
npm install
lint-js:
npm run lint:js
typecheck-js:
npm run typecheck
lint-assets:
npm run optimize-assets > /dev/null
git diff --quiet assets/img || (echo "Error: Optimize SVG images using 'npm run optimize-assets'"; exit 1)
lint-yaml: normalize-yaml
(! git diff --name-only | grep ".*\.yml$$") || (echo "Error: Run 'make normalize-yaml' to normalize YAML"; exit 1)
normalize-yaml: # Normalizes YAML files (alphabetizes keys, fixes line length, smart quotes)
npm run normalize-yaml
lint-css:
npm run lint:css
lint: lint-js lint-assets lint-yaml lint-css validate-lockfiles typecheck-js
test: build
bundle exec rspec spec
test-urls: build
bundle exec ./scripts/sitemap-check --directory _site --old-urls-file OLD_URLS.yml
htmlproofer:
bundle exec scripts/htmlproofer
JEKYLL_CONFIG_FILES ?= _config.yml
build: export NODE_ENV := production
build:
npm run build
bundle exec jekyll build --config $(JEKYLL_CONFIG_FILES)
nu:
grep --files-without-match --recursive "Click here if you are not redirected" -- _site | \
grep --invert-match admin/index.html | \
xargs ./scripts/vnu --skip-non-html --errors-only 2>&1
validate-gemfile-lock: Gemfile Gemfile.lock
@echo "Validating Gemfile.lock..."
@bundle check
@git diff-index --quiet HEAD Gemfile.lock || (echo "Error: There are uncommitted changes after running 'bundle install'"; exit 1)
validate-package-lock: package.json package-lock.json
@echo "Validating package-lock.json..."
@test -z "$$SKIP_INSTALL" && npm install --ignore-scripts || exit 0
@(! git diff --name-only | grep package-lock.json) || (echo "Error: There are uncommitted changes after running 'npm install'"; exit 1)
validate-lockfiles: validate-gemfile-lock validate-package-lock