Skip to content

Commit

Permalink
modify Blueprint.lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Dec 5, 2020
1 parent 653b5dd commit e63895b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/models/blueprint.js
Expand Up @@ -1279,6 +1279,20 @@ let Blueprint = CoreObject.extend({
Blueprint.lookup = function (name, options) {
options = options || {};

if (options.blueprintPath) {
let blueprintPath = path.resolve(options.blueprintPath);

if (Blueprint._existsSync(blueprintPath)) {
return Blueprint.load(blueprintPath);
}

if (!options.ignoreMissing) {
throw new SilentError(`Unknown blueprint: ${name}`);
}

return;
}

let lookupPaths = generateLookupPaths(options.paths);

let lookupPath;
Expand Down

0 comments on commit e63895b

Please sign in to comment.