Skip to content

Commit

Permalink
call local commands with new go-plugin-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
termosa committed Jul 8, 2018
1 parent d608ae7 commit e76fe98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/match-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ const matchCommand = (args, env) => new Promise((resolve) => {
require(env.configPath)

if (!args.length) {
return resolve(() => guide(go.getCommands()).then(go.executeCommand))
return resolve(() => guide(go.getCommands()).then(command => command.callback()))
}

if (!go.getCommands().length) return resolve(null)

const command = go.matchCommand(args.join(' '))
const commandRequest = args.join(' ')
const command = go.matchCommand(commandRequest)
if (!command) return resolve(null)

resolve(() => go.executeCommand(command))
resolve(() => go.executeCommand(commandRequest))
})

module.exports = matchCommand

0 comments on commit e76fe98

Please sign in to comment.