Skip to content

Commit

Permalink
feat: add ability to resolve path for custom generator file
Browse files Browse the repository at this point in the history
  • Loading branch information
kayterra authored and wesleytodd committed Jun 29, 2020
1 parent 1485388 commit aee7d7a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/migrate-create
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ function create (name) {
}

// Load the template generator
var gen = require(program.generator)
var gen
try {
gen = require(program.generator)
} catch (e) {
gen = require(path.resolve(program.generator))
}
gen({
name: name,
dateFormat: program.dateFormat,
Expand Down

0 comments on commit aee7d7a

Please sign in to comment.