distributable:
  url: https://github.com/ajeetdsouza/zoxide/archive/refs/tags/v{{version}}.tar.gz
  strip-components: 1

provides:
  - bin/zoxide

versions:
  github: ajeetdsouza/zoxide
  strip: /v/

build:
  dependencies:
    rust-lang.org/cargo: '*'
  script:
    cargo install --locked --path . --root {{prefix}}

test: |
  eval "$(zoxide init bash)"
  mkdir foo
  cd foo
  cd ..
  z foo
  pwd | grep -E '/foo$'