-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Support 'login-items' as a first-class citizen of the CLI #19744
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: master
Are you sure you want to change the base?
Conversation
c97b261
to
eaba8a8
Compare
Could someone please help? I am not sure if I am going in the right direction or not. Would love to get some feedback. This PR is trying to solve the #19333 ticket. |
7db01f2
to
ca5e83a
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.
@vraravam Looks good so far! Anything specific you need help with?
Thanks @MikeMcQuaid - I am first trying to cover all scenarios/commands from the CLI perspective, and finally will proceed to the actual implementation of the osascript calls. Hope that's fine with you? Also, I'm trying to ensure that all code that I write have tests - if I miss something (since this is my first time contributing to this codebase, i don't know the contributing guidelines/rules), please do point me in that direction as well. Based on the CLI commands, do you recon that I am missing any? I have tried with |
@vraravam Sounds good to me! When CI is 🟢 let us know and we can give this a more thorough review. CC @homebrew/cask folks for any thoughts before that, too. |
homepage "https://brew.sh/" | ||
|
||
app "Caffeine.app" | ||
login_items "Caffeine.app" |
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.
I think the dsl here should be login_item
, and repeated if there are multiple.
This will keep it consistent with the other artifacts, that aren't pluralised.
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.
do you mean like how multiple language
blocks are supported in the DSL?
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.
I'm referring to other artifacts such as app
, binary
, artifact
, font
, qlplugin
, etc..
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.
If we look at the everything.rb DSL, there are other stanzas that are pluralized as well maybe?
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.
All of the artifact stanzas (which I think a login item will most closely relate to) are not pluralised.
suite
app
pkg
installer
binary
manpage
colorpicker
dictionary
font
input_method
internet_plugin
keyboard_layout
prefpane
qlplugin
mdimporter
screen_saver
service
audio_unit_plugin
vst_plugin
vst3_plugin
For context, where multiple items doc the same type are allowed and provided the stanza is repeated rather than passing an array to the stanza.
@@ -13,6 +13,7 @@ | |||
==> Downloading file:.*caffeine.zip | |||
Already downloaded: .*--caffeine.zip | |||
==> Uninstalling Cask local-caffeine | |||
==> Skipping processing of login_items |
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.
I have a concern that there may be side effects of skipping the uninstallation of login_items
.
I understand having the option to automatically register a login_item
, but is the idea here to be able to skip uninstalling them? The reason we generally aim to remove as much as possible with brew uninstall
(which also runs with brew upgrade
) is to not leave things behind that aren't connected to the application anymore.
What happens if the login_item
changes between versions?
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.
Agree - I was also facing the same conundrum. This is predominantly for the usecase where the user has chosen to not uninstall by using --no-login-items
CLI switch. By default, the registered login items will be uninstalled (I think that's how I have coded it?)
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.
Two things I'm worried about here:
- how will this work on Linux
- more importantly: how can maintainers know the values are correct? The uninstall blocks are tested by CI, but how will this be tested?
For now, I'm only thinking of supporting macos. If needed, and if someone else can take up the work for linux, we can collaborate (I don't have a linux box to test this on)
That's the reason the onus on correctness is envisioned to be with the cask's author and not at the framework/tool maintainer. This is similar to how the |
If we systematically add a |
My assumption is the |
Not sure who the tool maintainer is in this case, but the most common scenario for casks is:
So you can see why I'd want to ensure the CI catches faulty entries here like it does for the uninstall step. |
i see your point @SMillerDev . I am only banking on the precedent scenario of how the |
7c0818a
to
62cc3ed
Compare
Would love some help in debugging the broken tests. can someone please point me in the general direction of what's wrong? |
6d7154b
to
1bbc19f
Compare
2acda6f
to
450f732
Compare
…the top-level Fix issues found when running brew cli commands (upgrade, update, install) Incorporate 'login_items' into 'info' command output (not yet verified) Incorporate 'login_items' option for 'reinstall' command
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?login_item
from under theuninstall
block to the top-levellogin_items
into info command output (not yet verified)login_items
option forreinstall
command