Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Exploration: space-separated subcommands #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down