Skip to content

Commit

Permalink
fix: change default blueprint name to 'default' rather than the addon…
Browse files Browse the repository at this point in the history
…'s name (#51)

Should resolve denali-js/core#435
  • Loading branch information
knownasilya authored and davewasmer committed Mar 8, 2018
1 parent c69b969 commit c507227
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ export default class Blueprint extends Command {
.reduce<{ [key: string]: typeof Blueprint }>((BlueprintsSoFar, dirname: string) => {
let BlueprintClass;
try {
BlueprintClass = require(path.join(dir, dirname));
let Klass = require(path.join(dir, dirname));
BlueprintClass = Klass.default || Klass;
} catch (e) {
throw new NestedError(`Unable to load blueprint from ${ dir } -> ${ dirname }`, e);
}
BlueprintClass.addon = addonName;
BlueprintsSoFar[dirname] = BlueprintClass.default || BlueprintClass;
BlueprintsSoFar[dirname] = BlueprintClass;
return BlueprintsSoFar;
}, {});
// Capture the source directory of the blueprint
Expand Down

0 comments on commit c507227

Please sign in to comment.