Skip to content

Commit

Permalink
feat(utils.js): requireHerbarium must be able to receive options
Browse files Browse the repository at this point in the history
Options passed to requireHerbarium must be passed to herbarium.requireAll, enabling custom paths.

herbsjs#171
  • Loading branch information
vitorgamer58 committed Nov 23, 2022
1 parent 879d041 commit 483e3ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generators/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
return list.join('\n')
},
pascalCase: (str) => startCase(camelCase(str)).replace(/ /g, ''),
requireHerbarium: (command, appPath) => {
requireHerbarium: (command, appPath, options = {}) => {
const herbariumPath = path.normalize(`${appPath}/src/domain/herbarium.js`)
let herbarium
if (command !== "new") {
Expand All @@ -44,7 +44,7 @@ module.exports = {
else
herbarium = require('@herbsjs/herbarium').herbarium

herbarium.requireAll()
herbarium.requireAll(options)
return herbarium
},
usingMongo: (base) => fs.existsSync(path.normalize(`${base}/src/infra/config/mongo.js`))
Expand Down

0 comments on commit 483e3ca

Please sign in to comment.