-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (39 loc) · 1.42 KB
/
Makefile
File metadata and controls
45 lines (39 loc) · 1.42 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
.PHONY: install uninstall check test help
INSTALL_PATH := /usr/local/bin/chainlist
SCRIPT_PATH := $(CURDIR)/chainlist.sh
help:
@echo "Chainlist CLI - Makefile"
@echo ""
@echo "Available targets:"
@echo " make check - Check if dependencies are installed"
@echo " make install - Install chainlist command globally"
@echo " make uninstall - Remove chainlist command"
@echo " make test - Run example searches"
@echo " make help - Show this help message"
check:
@echo "Checking dependencies..."
@command -v jq >/dev/null 2>&1 || { echo "❌ jq is not installed. Run: brew install jq"; exit 1; }
@echo "✓ jq is installed"
@command -v curl >/dev/null 2>&1 || { echo "❌ curl is not installed. Run: brew install curl"; exit 1; }
@echo "✓ curl is installed"
@test -f "$(SCRIPT_PATH)" || { echo "❌ chainlist.sh not found"; exit 1; }
@echo "✓ chainlist.sh found"
@echo "✓ All dependencies are satisfied"
install: check
@echo "Installing chainlist command..."
@chmod +x "$(SCRIPT_PATH)"
@ln -sf "$(SCRIPT_PATH)" "$(INSTALL_PATH)"
@echo "✓ Installed to $(INSTALL_PATH)"
@echo ""
@echo "You can now use: chainlist 42161"
uninstall:
@echo "Uninstalling chainlist command..."
@rm -f "$(INSTALL_PATH)"
@echo "✓ Removed $(INSTALL_PATH)"
test: check
@echo "Running test queries..."
@echo ""
@echo "Test 1: Find Arbitrum (chainId 42161)"
@./chainlist.sh 42161
@echo ""
@echo "✓ Tests completed"