-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
33 lines (27 loc) · 1.05 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
.PHONY: build build-all install install-system uninstall dev-shell
build:
@mkdir -p bin
@bun build --compile src/cli.ts --outfile bin/samecmd
build-all:
@./scripts/build-all.sh
install: build
@mkdir -p ~/.local/bin
@cp bin/samecmd ~/.local/bin/samecmd
@printf "\033[32m✓ Installed samecmd to ~/.local/bin/samecmd\033[0m\n"
@printf "\n"
@printf "[IMPORTANT] Next steps:\n"
@if ! which samecmd > /dev/null 2>&1; then \
printf " • \033[33mAdd ~/.local/bin to your PATH\033[0m\n"; \
printf " \033[2mexport PATH=\"\$$HOME/.local/bin:\$$PATH\"\033[0m\n"; \
fi
@printf " • \033[33mRun: \033[36msamecmd setup\033[0m\n"
install-system: build
@cp bin/samecmd /usr/local/bin/samecmd
@echo "✓ Installed samecmd to /usr/local/bin/samecmd"
uninstall:
@which samecmd > /dev/null 2>&1 || bun run src/cli.ts teardown 2>/dev/null || true
@./uninstall.sh
@echo " To uninstall system-wide: sudo rm /usr/local/bin/samecmd"
dev-shell:
@echo "Starting zsh with samecmd loaded from source..."
@zsh -c 'eval "$$(bun run src/cli.ts init zsh)"; exec zsh'