-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
tailscale-app: Generate completions for the installed CLI. #223049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The `tailscale-app` cask wraps `/Applications/Tailscale.app/Contents/MacOS/Tailscale` and places it into the path as `tailscale`. This command can generate its own completions. Support for this was added to the headless `tailscale` *formula* at Homebrew/homebrew-core#172679 This PR adds the same support to the `tailscale-app` cask, using the same mechanism.
I'm on cellular internet right now and I don't have a local checkout, so these are impractical to run. However, |
9a81fc9
to
45f92ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Casks/t/tailscale-app.rb
Outdated
@@ -28,6 +28,10 @@ | |||
EOS | |||
end | |||
|
|||
def install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter wants me to rewrite this to:
define_method(:install)
However, this also causes CI to fail: https://github.com/Homebrew/homebrew-cask/actions/runs/16798346181/job/47573677907
I'm not sure what I'm supposed to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like install
is not allowed by the linter, even though it is run by brew install --cask
? I'm going to try postflight
.
Okay, I'm at a bit of a loss. It seems that no casks use They all use:
That only leaves out However, these assume that there is a completion file rather than a completion command whose output provides the completions. I'm not sure what to do. |
Apart from the formula issues, I think you will find that the completion command will fail after a fresh install.
Even for help you need to be logged in
So (I'm not a maintainer nor an expert in brew) but I think this will be an issue. |
Ah, that's really unfortunate if that's the case. However, I just purged my entire Tailscale install (using AppCleaner and |
I think it was because I had another VPN running. Once I stopped that one, I was able issue CLI command. |
install do | ||
generate_completions_from_executable("#{appdir}/Tailscale.app/Contents/MacOS/Tailscale", "completion") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgarron Thanks for trying to get this work, but I don't believe it is possible to generate completions in this way for a Cask, only with a Formula. The completion
stanzas available only install the completions from an already built file.
The
tailscale-app
cask wraps/Applications/Tailscale.app/Contents/MacOS/Tailscale
and places it into the path astailscale
.This command can generate its own completions. Support for this was added to the headless
tailscale
formula at Homebrew/homebrew-core#172679This PR adds the same support to the
tailscale-app
cask, using the same mechanism.Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.
In the following questions
<cask>
is the token of the cask you're submitting.After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>
is error-free.brew style --fix <cask>
reports no offenses.