# examples: # garden build -- --offline # garden -D prefix=/usr/local install # garden -D prefix=/usr/local install-doc # garden -vv check # garden doc # # Variables can be set externally. e.g.: # garden -D DESTDIR=/tmp/stage -D prefix=/usr/local install-doc variables: DESTDIR: "" prefix: ~/.cargo bindir: ${prefix}/bin docdir: ${prefix}/share/doc/garden target: x86_64-unknown-linux-musl pkg: ${GARDEN_CONFIG_DIR}/pkg debdir: ${pkg}/deb fetch: "" disable-fetch: $ test -n "${fetch}" || printf '%s' --disable-fetch no-fetch: $ test -n "${fetch}" || printf '%s' --no-fetch # usage: # garden [] [-- []] commands: bench: cargo bench "$@" build: cargo build "$@" check>: - check/fmt - check/audit - check/clippy - check/deny - test check/audit: | if type cargo-audit >/dev/null 2>&1 then cargo audit ${no-fetch} "$@" fi check/clippy: cargo clippy --all "$@" -- -D warnings check/deny: | if type cargo-deny >/dev/null 2>&1 then cargo deny check ${disable-fetch} "$@" fi check/fmt: cargo fmt --check "$@" clean: cargo clean "$@" commit: git commit "$@" coverage: cargo kcov "$@" diff: git diff "$@" diffs: git diff --staged "$@" doc: | env RUSTDOCFLAGS='-D warnings' \ cargo doc --no-deps --document-private-items --workspace cd ./doc mdbook build --dest-dir book.new rsync -r --delete --exclude=.git book.new/ book/ rm -rf book.new fix: cargo clippy --all --fix "$@" -- -D warnings fmt: cargo fmt "$@" git: git "$@" install: cargo install --path . --root "${DESTDIR}${prefix}" install-doc<: doc install-doc: | mkdir -p "${DESTDIR}${docdir}" rsync -r --exclude=.git doc/book/ "${DESTDIR}${docdir}/" pkg/deb>: - pkg/deb/build - pkg/deb/completion - pkg/deb/doc - pkg/deb/package pkg/deb/build: | cargo build --profile deb --target "${target}" pkg/deb/completion: | mkdir -p "${debdir}/completion" "$0" completion bash >"${debdir}/completion/garden.bash" "$0" completion fish >"${debdir}/completion/garden.fish" "$0" completion zsh >"${debdir}/completion/_garden" pkg/deb/doc: mdbook build --dest-dir "${debdir}/userguide" doc pkg/deb/package: cargo deb --profile deb --target "${target}" push: git push "$@" setup: | git fetch -q pages 2>/dev/null || ( cat <<-\EOF error: The "pages" remote is not available. To fix this, run this command and try again: garden grow . EOF return 1 ) garden ${GARDEN_CMD_VERBOSE} grow doc garden ${GARDEN_CMD_VERBOSE} grow homebrew stage: git add --update "$@" stat: git status --short "$@" status: git status "$@" test: cargo test "$@" update: cargo update "$@" watch: cargo watch --shell "garden ${GARDEN_CMD_VERBOSE} build && garden ${GARDEN_CMD_VERBOSE} check" # Trees define named repositories where commands are run. trees: garden: description: Garden grows and cultivates collections of Git trees path: ${GARDEN_CONFIG_DIR} url: "git@gitlab.com:garden-rs/garden.git" remotes: davvid: "git@gitlab.com:davvid/garden.git" github: "git@github.com:garden-rs/garden.git" jordilin: "git@github.com:jordilin/garden.git" jtietema: "git@github.com:jtietema/garden.git" slackline: "git@github.com:slackline/garden.git" pages: "git@gitlab.com:garden-rs/garden-rs.gitlab.io.git" gitconfig: remote.origin.pushurl: - "git@gitlab.com:garden-rs/garden.git" - "git@github.com:garden-rs/garden.git" branch.pages.remote: pages remote.pages.pushurl: - "git@gitlab.com:garden-rs/garden-rs.gitlab.io.git" - "git@github.com:garden-rs/garden.git" links: - "https://garden-rs.gitlab.io" - "https://crates.io/crates/garden-tools" - "https://docs.rs/garden-tools/latest/garden/" - "https://lib.rs/crates/garden-tools" - "https://gitlab.com/garden-rs/garden" - "https://github.com/garden-rs/garden" doc: description: Prebuilt garden user manual for garden-rs.gitlab.io path: doc/book worktree: garden branch: pages branches: pages: pages/pages homebrew: description: Homebrew tap for installing Garden on macOS url: "git@gitlab.com:garden-rs/homebrew-garden.git" remotes: github: "git@github.com:garden-rs/homebrew-garden.git" gitconfig: remote.origin.pushurl: - "git@gitlab.com:garden-rs/homebrew-garden.git" - "git@github.com:garden-rs/homebrew-garden.git" links: - "https://gitlab.com/garden-rs/homebrew-garden" groups: all: - garden - doc - homebrew