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

Commit

Permalink
fix: add props to config
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 3721a5c commit c09c281
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {PJSON} from './pjson'
import * as Plugin from './plugin'
import {Topic} from './topic'
import {tsPath} from './ts_node'
import {compact, flatMap, loadJSONSync} from './util'
import {compact, flatMap, loadJSONSync, uniq} from './util'

export type PlatformTypes = 'darwin' | 'linux' | 'win32' | 'aix' | 'freebsd' | 'openbsd' | 'sunos'
export type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86'
Expand All @@ -22,6 +22,8 @@ export interface Options extends Plugin.Options {
const debug = Debug()

export interface IConfig {
name: string
version: string
pjson: PJSON.CLI
/**
* process.arch
Expand Down Expand Up @@ -261,7 +263,7 @@ export class Config implements IConfig {
}

get commands(): Command.Plugin[] { return flatMap(this.plugins, p => p.commands) }
get commandIDs() { return this.commands.map(c => c.id) }
get commandIDs() { return uniq(this.commands.map(c => c.id)) }

protected dir(category: 'cache' | 'data' | 'config'): string {
const base = process.env[`XDG_${category.toUpperCase()}_HOME`]
Expand Down

0 comments on commit c09c281

Please sign in to comment.