-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
58 lines (44 loc) · 1.64 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
THEME_PATH := $(CURDIR)
DEV_GHOST_PATH := '/Users/toddbirchard/Projects/ghostlocal'
DEV_GHOST_THEME_PATH := '/Users/toddbirchard/Projects/ghostlocal/content/themes/hackersandslackers-theme'
define HELP
Manage development of Hackersandslackers Ghost theme.
Usage:
make build - Install all dependencies & build theme.
make dev - Restart local ghost instant and compile site.
make clean - Purge cache, locked, dependencies, logs, & lockfiles.
make update - Update production dependencies to latest versions.
make reset - Clean, update, and build site.
endef
export HELP
.PHONY: build dev clean update reset help
all help:
@echo "$$HELP"
.PHONY: build
build:
yarn run build
.PHONY: dev
dev:
if [ -d $(DEV_GHOST_THEME_PATH) ]; then rm -rf $(DEV_GHOST_THEME_PATH); fi
cp -R $(THEME_PATH) $(DEV_GHOST_THEME_PATH) && \
cd $(DEV_GHOST_THEME_PATH) && npm run dev && \
cd $(DEV_GHOST_PATH) && ghost restart --verbose && cd $(THEME_PATH)
.PHONY: clean
clean:
find . -name 'package-lock.json' -delete
find . -name 'yarn-error.log' -delete
find . -name '.pnp.cjs' -delete
find . -name '*.map' -delete
find . -wholename 'assets/built/*.js' -exec rm -rf {} +
find . -wholename 'assets/built/*.css' -exec rm -rf {} +
find . -wholename '*.lock' -delete
find . -type d -wholename './.yarn' -exec rm -rf {} +
find . -type d -wholename '**/node_modules' -exec rm -rf {} +
.PHONY: update
update:
npm install -g npm@latest && \
npm install -g yarn && \
npm install -g npm-check-updates@latest && \
npm install -g ghost-cli@latest && \
cd $(DEV_GHOST_PATH) && ghost update && \
cd $(DEV_GHOST_THEME_PATH) && ncu