Skip to content

Commit

Permalink
Fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Apr 7, 2018
1 parent 6f10132 commit e346d22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/cmdPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let id = 0
let getId = () => pref + id++

// self.command = function (cmd (command), description, builder, handler, middlewares) {
const template = (p, id) => `.command(${id}.command, ${id}.description, ${id}.builder, ${id}.handler, ${id}.middlewares)\n`
const template = (p, id) => `.command(${id}.command, ${id}.describe || ${id}.description, ${id}.builder || _builderNOOP, ${id}.handler, ${id}.middlewares)\n`
const templateH = (p, id) => `const ${id} = require('${p}')`


Expand Down Expand Up @@ -40,7 +40,7 @@ function replace(P, D) {
})
return out
})
if (define.length) c = c.replace("'use strict'", "'use strict'\n" + define.map(a => templateH(...a)).join('\n') + '\n')
if (define.length) c = c.replace("'use strict'", "'use strict'\nconst _builderNOOP = y => y\n" + define.map(a => templateH(...a)).join('\n') + '\n')
console.log('[%s]: Patched!', path.relative(main, P))
fs.writeFileSync(out, c)
}
Expand Down

0 comments on commit e346d22

Please sign in to comment.