-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
66 lines (54 loc) · 2.27 KB
/
Copy pathJustfile
File metadata and controls
66 lines (54 loc) · 2.27 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
# Installation (for development)
install:
#!/bin/bash
cargo install --path . -f
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then mkdir -p "$APPDATA/wasmic/" && cp config.yaml "$APPDATA/wasmic/"; \
elif [[ "$OSTYPE" == "darwin"* ]]; then mkdir -p "$HOME/Library/Application Support/wasmic/" && cp config.yaml "$HOME/Library/Application Support/wasmic/"; \
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then mkdir -p ~/.config/wasmic/ && cp config.yaml ~/.config/wasmic/; \
fi
# Development commands
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
lint:
cargo check
cargo clippy -- -D warnings
cargo test
cargo machete
lint-fix: fmt
cargo clippy --fix --allow-dirty --allow-staged
cargo sort
cargo machete --fix
# CI tool installation (using cargo-binstall, minimal dependencies)
install-tools:
#!/bin/bash
@echo "Installing cargo-binstall..."
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then \
where cargo-binstall > nul 2>&1 || powershell -Command "irm https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | iex"; \
else \
which cargo-binstall > /dev/null || curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash; \
fi
@echo "Installing rustfmt..."
cargo fmt --version > /dev/null || rustup component add rustfmt
cargo clippy --version > /dev/null || rustup component add clippy
cargo binstall cargo-sort
cargo binstall cargo-machete
# Application commands
call: call-time call-fetch
call-time:
cargo run -- call --config config.yaml --function "time.get-current-time" --args "{}"
call-fetch:
cargo run -- call --config config.yaml --function "fetch.fetch" --args '{"url":"https://httpbin.org/get", "headers":[]}'
list:
cargo run -- --config config.yaml list
# Full test suite
full-test:
cargo test
cargo clippy -- -D warnings
@echo "✅ Full test suite passed"
# Setup for new developers
setup: install-tools
@echo "✅ Development environment setup complete"
search:
cargo run -- call --config config.yaml --function "brave_search.search" --args '{"params": {"query": "AI news artificial intelligence latest developments","limit": 10,"country": "US","language": "en","safe-search": "moderate","include-text": true}}'