-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
granted: install shell wrappers and assumego symlink #248898
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
bash script alone should be enough, i see no reason to have another script that does the same thing but with
.fishextensionUh oh!
There was an error while loading. Please reload this page.
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.
This file is required because Granted supports the fish shell (https://docs.commonfate.io/granted/configuration#fish). It is a different script to
assume. The regularassumeshell script is incompatible with fish, so we need to also include this file with the .fish extension.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.
Just adding -- during normal use these scripts get sourced into the shell, not executed, so the script doesn't control its interpreter. The script needs to be natively compatible with the shell.
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 they need to be sourced instead of executed, why write them to
bin?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 use granted, and also support fish users using granted. The change above mirrors how granted was installed previously:
https://github.com/common-fate/homebrew-granted/blob/6bef334c52370f99931864c66e66a472798d05ff/Formula/granted.rb
Can't speak to why both of these are written to bin, but this does match how the granted authors intended this package to be installed.
Uh oh!
There was an error while loading. Please reload this page.
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.
My concern is this:
If we put it in
bin, will users be expecting that. Or can we make it easier somehow?If it needs to be sourced, we can put it in a directory that automatically gets sourced. That seems more user friendly to me.
If it just needs to be in PATH when granted is executed, maybe we can make a wrapper script that does that.
But it's still unclear to me how/if users are expected to interact with
assumeThere 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.
@chrnorm could you help clarify here? What are users expecting? Are they expecting to call
assume? Or are they expectingassumeto be sourced when they open their shell?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 is called by users. However, the first time that Granted runs, it installs an alias in users' shell profile (such as
~/.bashrc), for example:so when they call assume they are sourcing the script. The script is not sourced automatically when users open their shell, though.
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.
Okay, so it's only ever called once by users. Because afterwards it will run the alias instead when people do
assume. So what if we just makebin/assumea script that sourcessome/path/assume?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.
@chrnorm That hardcoded path isn't critical, since we can
inreplaceit at build. In the event we want to throw it intolibexecor something that's what we'd do.