Skip to content

Commit

Permalink
pass all options to readMaidFile and update error message
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <[email protected]>
  • Loading branch information
Charlike Mike Reagent committed Jun 6, 2018
1 parent 84c28d7 commit 6fe8bcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const runCLICommand = require('./runCLICommand')

class Maid {
constructor(opts = {}) {
this.maidfile = readMaidFile(opts.section)
this.maidfile = readMaidFile(opts)
logger.setOptions({ quiet: opts.quiet })

if (!this.maidfile) {
throw new MaidError('No maidfile was found. Stop.')
throw new MaidError('No config file was found or was not valid. Stop.')
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/readMaidFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const parseMarkdown = require('./parseMarkdown')
const loadFile = require('./loadFile')

module.exports = section => {
module.exports = ({ section } = {}) => {
const { path: filepath, data } = loadFile.loadSync([
'maidfile.md',
'README.md',
Expand Down

0 comments on commit 6fe8bcf

Please sign in to comment.