Skip to content

Commit b6b9a7a

Browse files
committed
Simplify taplo installation command
1 parent 36bab1b commit b6b9a7a

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

Makefile

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -288,40 +288,11 @@ setup-wasm: ## Setup the WebAssembly toolchain, using nightly
288288
cargo install wasm-bindgen-cli --version ${WASM_BINDGEN_CLI_VERSION}
289289

290290
.PHONY: setup-taplo
291-
setup-taplo: ## Install taplo TOML formatter if not present
292-
@if ! command -v taplo &> /dev/null; then \
293-
echo "Installing taplo..."; \
294-
if command -v cargo-binstall &> /dev/null; then \
295-
cargo binstall -y taplo-cli; \
296-
else \
297-
TAPLO_VERSION="0.9.3"; \
298-
OS=$$(uname -s | tr '[:upper:]' '[:lower:]'); \
299-
ARCH=$$(uname -m); \
300-
case "$$OS" in \
301-
darwin) OS="darwin" ;; \
302-
linux) OS="linux" ;; \
303-
*) echo "Unsupported OS: $$OS"; exit 1 ;; \
304-
esac; \
305-
case "$$ARCH" in \
306-
x86_64) ARCH="x86_64" ;; \
307-
arm64|aarch64) ARCH="aarch64" ;; \
308-
*) echo "Unsupported architecture: $$ARCH"; exit 1 ;; \
309-
esac; \
310-
TAPLO_URL="https://github.com/tamasfe/taplo/releases/download/$${TAPLO_VERSION}/taplo-full-$${OS}-$${ARCH}.gz"; \
311-
echo "Downloading taplo from $${TAPLO_URL}..."; \
312-
curl -L "$${TAPLO_URL}" | gunzip > /tmp/taplo; \
313-
chmod +x /tmp/taplo; \
314-
if [ -d "$$HOME/.cargo/bin" ]; then \
315-
mv /tmp/taplo "$$HOME/.cargo/bin/taplo"; \
316-
echo "Installed taplo to ~/.cargo/bin/taplo"; \
317-
else \
318-
echo "Warning: ~/.cargo/bin not found, taplo installed to /tmp/taplo"; \
319-
echo "Please add ~/.cargo/bin to PATH or move /tmp/taplo manually"; \
320-
fi; \
321-
fi; \
322-
else \
323-
echo "taplo is already installed"; \
324-
fi
291+
setup-taplo: ## Install taplo TOML formatter
292+
cargo install taplo-cli
293+
294+
.PHONY: setup
295+
setup: setup-taplo setup-wasm ## Setup development environment
325296

326297
.PHONY: test
327298
test: ## Run tests

0 commit comments

Comments
 (0)