Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Commit

Permalink
fix: rename subGenerator.from to subGenerator.generator
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Nov 11, 2018
1 parent 8996b0b commit d005ca6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ class SAO {
}

if (generator.subGenerator) {
// TODO: remove config.generators support, you should use `subGenerators` instead
// TODO: remove `config.generators` support, you should use `subGenerators` instead
const subGenerators = config.subGenerators || config.generators
const subGenerator =
subGenerators &&
subGenerators.find(g => g.name === generator.subGenerator)
if (subGenerator) {
const generatorPath = isLocalPath(subGenerator.from)
? path.resolve(generator.path, subGenerator.from)
: resolveFrom(generator.path, subGenerator.from)
// TODO: remove `subGenerator.from` support, you should use `subGenerator.generator` instead
let generatorPath = subGenerator.generator || subGenerator.from
generatorPath = isLocalPath(generatorPath)
? path.resolve(generator.path, generatorPath)
: resolveFrom(generator.path, generatorPath)
return this.run(parseGenerator(generatorPath), generator)
}
throw new SAOError(`No such sub generator in generator ${generator.path}`)
Expand Down

0 comments on commit d005ca6

Please sign in to comment.