npmci/ts/npmci.config.ts

27 lines
736 B
TypeScript
Raw Normal View History

2016-11-24 22:21:40 +00:00
import * as q from 'q'
import * as plugins from './npmci.plugins'
import * as paths from './npmci.paths'
2017-08-28 15:11:47 +00:00
import { repo } from './npmci.env'
import { KeyValueStore } from 'npmextra'
2016-11-24 22:21:40 +00:00
export interface INpmciOptions {
2017-08-28 15:19:31 +00:00
npmGlobalTools: string[]
dockerRegistryRepoMap: any
2016-11-24 22:21:40 +00:00
}
2017-08-28 15:11:47 +00:00
// instantiate a kvStorage for the current directory
2017-08-28 15:19:31 +00:00
export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`)
2017-08-28 15:11:47 +00:00
2017-03-08 13:50:41 +00:00
export let getConfig = async (): Promise<INpmciOptions> => {
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
let defaultConfig: INpmciOptions = {
2017-08-28 15:19:31 +00:00
npmGlobalTools: [],
dockerRegistryRepoMap: {}
2017-03-08 13:50:41 +00:00
}
let npmciConfig = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig)
return npmciConfig
2016-11-24 22:21:40 +00:00
}