-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (45 loc) · 1.65 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
SHELL := /usr/bin/env bash
RUBY_VERSION := "$(shell ruby -v)"
RUBY_VERSION_REQUIRED := "$(shell cat .ruby-version)"
RUBY_MATCH := $(shell [[ "$(shell ruby -v)" =~ "ruby $(shell cat .ruby-version)" ]] && echo matched)
.PHONY: ruby-version-check scaffold-plugin
ruby-version-check:
ifndef RUBY_MATCH
$(error ruby $(RUBY_VERSION_REQUIRED) is required. Found $(RUBY_VERSION). $(newline)Run `rbenv install $(RUBY_VERSION_REQUIRED)`)$(newline)
endif
install-prerequisites:
npm install -g [email protected]
# Installs npm packages and gems.
install: ruby-version-check
npm ci
bundle install
cd tools/frontmatter-validator && npm ci
validate-frontmatters:
npm --prefix tools/frontmatter-validator run validate
# Using local dependencies, starts a doc site instance on http://localhost:4000.
run: ruby-version-check validate-frontmatters
netlify dev
run-debug: ruby-version-check
JEKYLL_LOG_LEVEL='debug' netlify dev
build: ruby-version-check
exe/build
# Cleans up all temp files in the build.
# Run `make clean` locally whenever you're updating dependencies, or to help
# troubleshoot build issues.
clean:
-rm -rf dist
-rm -rf app/.jekyll-cache
-rm -rf app/.jekyll-metadata
-rm -rf .jekyll-cache/vite
kill-ports:
@JEKYLL_PROCESS=$$(lsof -ti:4000) && kill -9 $$JEKYLL_PROCESS || true
@VITE_PROCESS=$$(lsof -ti:3036) && kill -9 $$VITE_PROCESS || true
vale:
-git diff --name-only --diff-filter=d HEAD | grep '\.md$$' | xargs vale
scaffold-plugin:
@if [ -z "$(PLUGIN)" ]; then \
echo "Error: Plugin name is required. Usage: make scaffold-plugin PLUGIN=<plugin-name>"; \
exit 1; \
fi
cd tools/scaffold-plugin && npm ci
node tools/scaffold-plugin/index.js $(PLUGIN)