-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (57 loc) · 1.85 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
63
64
65
66
67
68
69
.DEFAULT_GOAL := help
# Shell settings
SHELL := /bin/bash
# Use an empty target to force running every time
.PHONY: FORCE
FORCE:
# Quarto
docs: FORCE ## [docs] Generate documentation
@echo "📖 Generating documentation"
quarto render
docs-preview: FORCE ## [docs] Watch documentation
@echo "📖 Watching documentation"
quarto preview
# Creating extensions
DIR:=
create-extension: ## [ext] Create extension folder
@if [ -z "$(DIR)" ]; then \
echo 'Please provide a directory name using `make create-extension DIR="my_dir"'; \
exit 1; \
fi
@# If the directory contains a slash, error
@if echo $(DIR) | grep -q '/'; then \
echo 'Please provide a directory name without a slash'; \
exit 1; \
fi
@# If the directory already exists, error
@if [ -d "extensions/$(DIR)" ]; then \
echo 'Directory "extensions/$(DIR)" already exists'; \
exit 1; \
fi
@echo "🔧 Creating directory: extensions/$(DIR)"
@mkdir -p "extensions/$(DIR)"
@echo "📝 Copying template files: $(ls -m _template)"
@cp -r _template/* extensions/$(DIR)
@echo ""
@echo "⏳ Remaining Tasks:"
@echo "- [ ] Copy in app files"
@echo "- [ ] Create manifest.json"
# build: FORCE ## [py] Build python package
# @echo "🧳 Building python package"
# @[ -d dist ] && rm -r dist || true
# uv build
help: FORCE ## Show help messages for make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; { \
printf "\033[32m%-18s\033[0m", $$1; \
if ($$2 ~ /^\[docs\]/) { \
printf "\033[34m[docs]\033[0m%s\n", substr($$2, 7); \
} else if ($$2 ~ /^\[py\]/) { \
printf " \033[33m[py]\033[0m%s\n", substr($$2, 5); \
} else if ($$2 ~ /^\[ext\]/) { \
printf " \033[35m[ext]\033[0m%s\n", substr($$2, 6); \
} else if ($$2 ~ /^\[r\]/) { \
printf " \033[31m[r]\033[0m%s\n", substr($$2, 4); \
} else { \
printf " %s\n", $$2; \
} \
}'