-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (71 loc) · 3.1 KB
/
Makefile
File metadata and controls
77 lines (71 loc) · 3.1 KB
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
70
71
72
73
74
75
76
77
.PHONY: install build clean test
CYAN := \033[0;36m
GREEN := \033[0;32m
RED := \033[0;31m
DIM := \033[2m
BOLD := \033[1m
NC := \033[0m
LOG := /tmp/rundev-build.log
install:
@printf "\n"
@printf " $(CYAN)$(BOLD) ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗██╗ ██╗$(NC)\n"
@printf " $(CYAN)$(BOLD) ██╔══██╗██║ ██║████╗ ██║ ██╔══██╗██╔════╝██║ ██║$(NC)\n"
@printf " $(CYAN)$(BOLD) ██████╔╝██║ ██║██╔██╗ ██║ ██║ ██║█████╗ ██║ ██║$(NC)\n"
@printf " $(CYAN)$(BOLD) ██╔══██╗██║ ██║██║╚██╗██║██╗██║ ██║██╔══╝ ╚██╗ ██╔╝$(NC)\n"
@printf " $(CYAN)$(BOLD) ██║ ██║╚██████╔╝██║ ╚████║╚═╝██████╔╝███████╗ ╚████╔╝ $(NC)\n"
@printf " $(CYAN)$(BOLD) ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚══════╝ ╚═══╝ $(NC)\n"
@printf "\n"
@printf " $(BOLD)AI-native local dev environment$(NC)\n"
@printf " $(DIM)Replaces MAMP/nginx — manages services, reverse proxy,$(NC)\n"
@printf " $(DIM)SSL certs, and live AI crash diagnosis from one dashboard.$(NC)\n"
@printf "\n"
@printf " $(DIM)by Daniel Tamas • getrun.dev$(NC)\n"
@printf "\n"
@printf " ────────────────────────────────────────\n"
@printf "\n"
@cargo install --path . > $(LOG) 2>&1 & \
PID=$$!; \
FRAMES="⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏"; \
I=0; \
while kill -0 $$PID 2>/dev/null; do \
F=$$(echo $$FRAMES | cut -d' ' -f$$((I % 10 + 1))); \
printf "\r $(CYAN)$$F$(NC) Building..."; \
I=$$((I + 1)); \
sleep 0.1; \
done; \
wait $$PID; EXIT=$$?; \
printf "\r"; \
if [ $$EXIT -ne 0 ]; then \
printf " $(RED)✗$(NC) Build failed:\n\n"; \
cat $(LOG); \
exit 1; \
fi
@ln -sf "$$HOME/.cargo/bin/rundev" "$$HOME/.cargo/bin/run.dev" 2>/dev/null || true
@printf " $(GREEN)✓$(NC) run.dev installed — run $(BOLD)rundev$(NC) or $(BOLD)run.dev$(NC) to start\n\n"
build:
@printf "\n $(CYAN)→$(NC) Building run.dev (debug)...\n"
@cargo build > $(LOG) 2>&1 & \
PID=$$!; \
FRAMES="⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏"; \
I=0; \
while kill -0 $$PID 2>/dev/null; do \
F=$$(echo $$FRAMES | cut -d' ' -f$$((I % 10 + 1))); \
printf "\r $(CYAN)$$F$(NC) Building..."; \
I=$$((I + 1)); \
sleep 0.1; \
done; \
wait $$PID; EXIT=$$?; \
printf "\r"; \
if [ $$EXIT -ne 0 ]; then \
printf " $(RED)✗$(NC) Build failed:\n\n"; \
cat $(LOG); \
exit 1; \
fi
@printf " $(GREEN)✓$(NC) Built — ./target/debug/rundev\n\n"
test:
@printf "\n $(CYAN)→$(NC) Running tests...\n"
@cargo test 2>&1 | tail -3
@printf "\n"
clean:
@cargo clean -q
@printf " $(GREEN)✓$(NC) Cleaned\n"