-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use $nu.data-dir
as last directory for vendor autoloads on all platforms
#14879
Conversation
If this comment still valid, about MacOS, after this PR? nushell/crates/nu-protocol/src/eval_const.rs Line 268 in b97d89a
|
@fdncred Thanks - I did mean to clean those up, then forgot :-/ The comments also need a few other adjustments, I believe. |
@NotTheDr01ds This seems have changed my last vendor autoload dir incorrectly
|
@Bahex What does |
@NotTheDr01ds it's set correctly to |
Thanks - I see the problem. Fixing now. |
@Bahex Fix is going through CI at the moment. Apologies for the bad testing on my part. At the moment, I have to rely on "eyeballing" the path. I really wish we had a way to test autoload code, but I can't find a way to place test files in a "sandboxed" |
Fix issue in #14879 with incorrect subdirectory. Before: Appended `vendor/autoload` After: Appends `nushell/vendor/autoload`
Description
Should fix #14872.
Before
The vendor autoload code in #13382 has the same issue that I just fixed in user-autoloads via #14877. Specifically, it uses
dirs::data_dir()
(from thedirs
crate), leading to a different behavior whenXDG_DATA_HOME
is set on each platform.dirs
crate automatically usesXDG_DATA_HOME
fordirs::data_dir()
, so everything worked as expected.dirs
doesn't use the XDG spec, but the vendor autoload code from Use directories for autoloading #13382 specifically addedXDG_DATA_HOME
. However, even ifXDG_DATA_HOME
was set, vendor autoloads would still use thedirs
version as well.XDG_DATA_HOME
was ignored completely by vendor autoloads, even though$nu.data-dirs
was respecting it.After
This PR uses
nu::data_dirs()
on all platforms.nu::data_dirs()
respectsXDG_DATA_HOME
(if set) on all platforms.User-Facing Changes
Might be a breaking change if someone was depending on the old behavior, but the doc already specified the behavior in this PR.
Tests + Formatting
toolkit fmt
toolkit clippy
toolkit test
toolkit test stdlib
After Submitting
Documentation already reflects the behavior in this PR.