install.fairie/.config/taskfiles/install/Taskfile-rust.yml

62 lines
1.2 KiB
YAML
Raw Normal View History

2022-12-24 12:04:59 -08:00
---
version: '3'
tasks:
bundle:
deps:
- grex
- htmlq
- hyperfine
catfs:
run: once
cmds:
- task: install:rust
vars:
BIN_NAME: catfs
PACKAGE: catfs
clean:
cmds:
- rm -rf "$HOME/.cargo/registry"
grex:
run: once
cmds:
- task: install:rust
vars:
BIN_NAME: grex
PACKAGE: grex
htmlq:
run: once
cmds:
- task: install:rust
vars:
BIN_NAME: htmlq
PACKAGE: htmlq
hyperfine:
run: once
cmds:
- task: install:rust
vars:
BIN_NAME: hyperfine
PACKAGE: hyperfine
install:rust:
vars:
BIN: '{{if .BIN_NAME}}{{.BIN_NAME}}{{else}}{{.PACKAGE}}{{end}}'
run: when_changed
log:
error: Failed to install Cargo crate `{{.PACKAGE}}`
start: Installing Cargo crate `{{.PACKAGE}}`
success: Installed Cargo crate `{{.PACKAGE}}`
cmds:
- task: :install:software:rust
- |
if [ -n "$CI" ]; then echo "*************** cargo --> {{.PACKAGE}}"; fi
- cargo install {{.PACKAGE}}
status:
- type {{.BIN}} > /dev/null || [ -n "$NO_INSTALL_RUST" ]