Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,42 @@ changelog:
exclude:
- '^docs:'
- '^test:'
brews:
homebrew_casks:
- name: trellis-cli
homepage: https://roots.io/trellis
description: A CLI to manage Trellis projects
caveats: |-
## Virtualenv

trellis-cli uses Virtualenv to manage dependencies such as Ansible which it
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message basically replaces homebrew's broken autocomplete install? I'm good with this if so

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

I found no easy way to make homebrew install auto completion. Therefore, show the message to ask users to $ eval "$(trellis shell-init zsh)" and $ trellis --autocomplete-install manually

automatically activates and uses when running any `trellis` command.
But there's still a lot of times you may want to run `ansible-playbook` or `pip`
manually in your shell. To make this experience seamless, trellis-cli offers
shell integration which automatically activates the Virtualenv when you enter a
Trellis project, and deactivates when you leave it.

To enable this integration, add the following to your shell profile:

Bash (`~/.bash_profile`):
eval "$(trellis shell-init bash)"

Zsh (`~/.zshrc`):
eval "$(trellis shell-init zsh)"

## Autocompletes

To install shell completions, run the following:
trellis --autocomplete-install

It should modify your `.bash_profile`, `.zshrc` or similar.
binaries:
- trellis
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/trellis"]
end
repository:
owner: roots
name: homebrew-tap
directory: Formula
homepage: https://roots.io/trellis
description: A CLI to manage Trellis projects
install: |
bin.install "trellis"
test: |
system "#{bin}/trellis --autocomplete-install"
system "#{bin}/trellis -v"
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,7 @@ roots/trellis-cli https://slsa.dev/provenance/v1 .github/workflows/release.yml

### Autocompletes

Homebrew installs trellis-cli's shell completion automatically by default. If shell completions aren't working, or you installed manually not using Homebrew, you'll need to install the completions manually.

To use the trellis-cli's autocomplete via Homebrew's shell completion:

1. Follow Homebrew's install instructions https://docs.brew.sh/Shell-Completion

Note: For zsh, as the instructions mention, be sure compinit is autoloaded and called, either explicitly or via a framework like oh-my-zsh.

2. Then run:

```bash
brew reinstall trellis-cli
```

To install shell completions manually, run the following:
To install shell completions, run the following:

```bash
trellis --autocomplete-install
Expand Down Expand Up @@ -309,4 +295,3 @@ Keep track of development and community news.
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Follow the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)

Loading