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

Commit

Permalink
fix: add commandIds
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 168ba2c commit a806741
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>
runHook<T extends Hooks, K extends keyof T>(event: K, opts: T[K]): Promise<void>
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a806741

Please sign in to comment.