From b9775af7720d1bfaac16b25f77a1be0b13e084b4 Mon Sep 17 00:00:00 2001 From: Borek Bernard Date: Wed, 14 Nov 2018 10:45:53 +0100 Subject: [PATCH] exploration: space-separated subcommands This commit makes `commandIDs` return space-separated commands instead of colon-separated. --- src/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.ts b/src/plugin.ts index 30c3f949..3ee13f37 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -146,7 +146,7 @@ export class Plugin implements IPlugin { const p = path.parse(file) const topics = p.dir.split('/') let command = p.name !== 'index' && p.name - return [...topics, command].filter(f => f).join(':') + return [...topics, command].filter(f => f).join(' ') }) this._debug('found commands', ids) return ids @@ -162,7 +162,7 @@ export class Plugin implements IPlugin { if (cmd.default && cmd.default.run) return cmd.default return Object.values(cmd).find((cmd: any) => typeof cmd.run === 'function') } - const p = require.resolve(path.join(this.commandsDir, ...id.split(':'))) + const p = require.resolve(path.join(this.commandsDir, ...id.split(' '))) this._debug('require', p) let m try {