diff --git a/src/config.ts b/src/config.ts index 352e4827..09138be1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -95,6 +95,8 @@ export interface IConfig { npmRegistry: string userPJSON?: PJSON.User plugins: Plugin.IPlugin[] + commands: Command.Plugin[] + readonly commandIDs: string[] runCommand(id: string, argv?: string[]): Promise runHook(event: K, opts: T[K]): Promise @@ -263,6 +265,8 @@ export class Config implements IConfig { if (opts.must) throw new Error(`topic ${name} not found`) } + get commandIDs() { return this.commands.map(c => c.id) } + protected dir(category: 'cache' | 'data' | 'config'): string { const base = process.env[`XDG_${category.toUpperCase()}_HOME`] || (this.windows && process.env.LOCALAPPDATA)