-
Notifications
You must be signed in to change notification settings - Fork 788
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
Allow suppression of error when no version of a tool is configured #1002
Comments
Thanks for taking the time to be thorough. This is partially related to #928
This only happens when executing a tool There are two solutions to this issue:
we could add filters to Also, we may add things like this to a recipes page in our docs after we launch an overhaul. |
Thanks for the great quick reply James.
The trouble I was having was that I was seeing this error output even when no command was being run, i.e. for every prompt in my shell. From what you say here, I realise that it's probably because these shims (ruby and node) are being run implicitly by something in my prompt or other shell integration. The noisiness I'm annoyed by isn't I'll check this shortly and probably close the issue |
Ah yes, that is the same scenario we discovered in #950. This can be very tricky when using These scenarios is why my distaste for the Python ecosystem which rely on a global unchanging runtime has grown over the past few years. The convenience of |
As I suspected the logged lines were caused by a function in my own profile startup code. (Ironically it was a function I created while I was trying to write an earlier version of the same script, to load the current active versions into variables 🤦🏻♂️). After removing those lines my shell is noiseless again 🎉 I still think there's a use case for me to be able to get the "closest" configured tools, ignoring any grandparent configuration. That gives me the option to answer the question "What tools does this project (at least claim to) use?". I could do this by manually scanning for the closest |
I'm closing this issue because my original premise was invalid. If you agree that there might be scope for some way to find the "closest" set of configured tools then I'll create a separate issue for that - I realise it's not as simple a suggestion as I first made it seem. |
I am glad you resolved your shell prompt issues.
Please do open an issue. It may stay open for a long time, but that gives others a chance to 👍 the issue and gives us an idea if the effort to implement and maintain is worth it. If you can provide a code snippet along with that which filters the |
@gareth here is are two one-liners that I think should do what you want, now that you've figured out what was producing those error messages. Assuming
Assuming the root of the Git repository is your project root :
Basically you can just grep |
Is your feature request related to a problem? Please describe
I work on multiple projects with different versions of tools - the kind of use case that
asdf
is great at managing.I'd like to display the active versions of tools in my prompt. The script would involve some variation of the following:
Outside of a project folder I don't need access to e.g. nodejs or elm (or even ruby to be honest). However, not having a version configured for the current folder (e.g. in a parent folder or
~/.tool-versions
) leads to an error displayed after every command:For some tools I can mitigate this: I can use
asdf global ruby system
to remove that warning from the toolchain. However for other tools with no system install (likenodejs
) this approach doesn't work.Describe the proposed solution
I would like some way to indicate (maybe at a global level, maybe per-tool) that the lack of a configured tool is not an error that needs to be alerted after every shell command.
Attempting to use an unconfigured tool can still fail the way it already does.
Describe similar
asdf
features and why they are not sufficientThe warning appears to be generated unconditionally by the asdf shell integration, and that's unavoidable and (to me) undesirable.
The aim is for my prompt in a project folder to only include versions of tools used by the project. Setting a global version of every plugin on my system means they all get reported by
asdf current
and it's impossible to extract just the tools relevant to the current project for the prompt.Describe other workarounds you've considered
I can mitigate this slightly by setting a
system
version of certain tools and altering my command to look like:but as mentioned above that only works for tools that can have a
system
value set.The text was updated successfully, but these errors were encountered: