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
[BUGFIX] Fix looking up the default blueprint for scoped addons #10091
Conversation
Thanks for reporting the issue and making this PR. Blueprint.lookup = function (name, options) {
options = options || {};
- if (name.includes(path.sep)) {
- let blueprintPath = path.resolve(name);
- let isNameAPath = Boolean(blueprintPath);
-
- if (isNameAPath) {
- if (Blueprint._existsSync(blueprintPath)) {
- return Blueprint.load(blueprintPath, options.blueprintOptions);
- }
-
- if (!options.ignoreMissing) {
- throw new SilentError(`Unknown blueprint: ${name}`);
- }
-
- return;
- }
- }
let lookupPaths = generateLookupPaths(options.paths);
let lookupPath;
for (let i = 0; (lookupPath = lookupPaths[i]); i++) {
let blueprintPath = path.resolve(lookupPath, name);
if (Blueprint._existsSync(blueprintPath)) {
return Blueprint.load(blueprintPath, options.blueprintOptions);
}
}
+ // Check if `name` itself is a path to a blueprint.
+ let blueprintPath = path.resolve(name);
+ if (Blueprint._existsSync(blueprintPath)) {
+ return Blueprint.load(blueprintPath, options.blueprintOptions);
+ }
if (!options.ignoreMissing) {
throw new SilentError(`Unknown blueprint: ${name}`);
}
}; |
I also noticed that the tests added in #9387 actually pass with and without the added code for supporting paths, so I'm going to try and fix that first to make sure we don't introduce any additional regressions. |
In this case, can we just add empty line to |
Made #10092 to fix the tests. |
Should we add a test for this case? |
2eebb4b
to
ce4bacb
Compare
#10092 was merged. Added a test for this fix as well. |
@GendelfLugansk Thanks for opening the issue and this PR! |
Fixes #10090 by checking if addon name starts with '@'