Skip to content
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

asdf shell failing should point out relevant file to source. #897

Closed
wants to merge 6 commits into from

Conversation

seivan
Copy link

@seivan seivan commented Mar 19, 2021

Summary

asdf shell will now point out what file to source.

@seivan seivan requested a review from a team as a code owner March 19, 2021 04:02
seivan added 4 commits March 19, 2021 05:03
Was using an older version, revert back to printf.
Fix linter
@seivan seivan changed the title [WIP] asdf shell failing should point out relevant file to source. asdf shell failing should point out relevant file to source. Mar 19, 2021
@jthegedus
Copy link
Contributor

I take it this is only really going to be hit by Homebrew installations as to get this far you'd have already set this up via our other installation methods?

@seivan
Copy link
Author

seivan commented Mar 24, 2021

I take it this is only really going to be hit by Homebrew installations as to get this far you'd have already set this up via our other installation methods?

Less than current situation, since I fixed both the installation and managed to add a caveat about it, less people should be hit.

It isn’t exactly clear why you need to source it until you actually do, but by then you’re already forgotten the caveat.

This should remind you.

@jthegedus
Copy link
Contributor

This should have a specific note about Homebrew then since only the users who setup the tool via Homebrew would see this.

No other setups would need to source the lib/asdf.{sh|fish}.

It seems to better support Homebrew these changes you're making are going to result in a completely different code path through asdf for these users, is that fair to say?

@seivan
Copy link
Author

seivan commented Mar 25, 2021

This should have a specific note about Homebrew then since only the users who setup the tool via Homebrew would see this.

How is this specific to Homebrew? This will show up if you run the executable.

No other setups would need to source the lib/asdf.{sh|fish}.

git clone asdf; cd asdf
./bin/asdf

The error shows up.

It seems to better support Homebrew these changes you're making are going to result in a completely different code path through asdf for these users, is that fair to say?

I don't understand this sentence, how is either the error or the explanation related to Homebrew? I didn't add the error message, I explained how to fix it.

"This is not enabled" => "This is not enabled, this is how you enable it".

@jthegedus
Copy link
Contributor

Yes, this is a simple change to add directions.

I am wondering if the case in which this error shows is ever actually needed. lib/asdf.sh is sourced in asdf.sh, so how are users ending up in the state where they haven't sourced asdf.sh and need lib/asdf.sh

Perhaps I should raise a different issue to discuss.

@jthegedus
Copy link
Contributor

jthegedus commented Mar 25, 2021

Point being, users shouldn't ever need to source lib/asdf.sh themselves. So the error message perhaps means asdf.sh and this change is further erroneous.

@seivan
Copy link
Author

seivan commented Mar 25, 2021

Yes, this is a simple change to add directions.

Better than no directions.

I am wondering if the case in which this error shows is ever actually needed. lib/asdf.sh is sourced in asdf.sh, so how are users ending up in the state where they haven't sourced asdf.sh and need lib/asdf.sh

I don't source either files.

If you're running the binary that's under /bin/ you will get this error.
The error didn't explain how to resolve it, and now it does so you can go on with your day.

Perhaps I should raise a different issue to discuss.

Maybe.

Point being, users shouldn't ever need to source lib/asdf.sh themselves. So the error message perhaps means asdf.sh and this change is further erroneous.

The thing is, asdf.sh does other things as well. Now I can see the value for that where people might not have their paths properly set up, or the priority is skewed to using system executables, that's a valid point, but it's a point not related to this particular error.

TL;DR
I personally don't source either files, but if I ever do want to run $ asdf shell I get reminded that I can source lib/asdf.sh and I event get the full path, so I don't have to worry what "source asdf" means to get the feature temporarily activated and move on.

Copy link
Member

@Stratus3D Stratus3D left a comment

Choose a reason for hiding this comment

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

Point being, users shouldn't ever need to source lib/asdf.sh themselves. So the error message perhaps means asdf.sh and this change is further erroneous.

I agree with this and I don't feel like this error message change is an improvement. I think we should either close this PR or change the error message to include a URL to relevant documentation.

@seivan seivan closed this Apr 2, 2021
@seivan seivan deleted the patch-2 branch April 2, 2021 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants