git improve npmextra.json config

This commit is contained in:
2017-08-28 17:19:31 +02:00
parent b9cc0556a8
commit 11ec419700
6 changed files with 16 additions and 9 deletions

View File

@ -57,7 +57,7 @@ export let install = async (versionArg) => {
await npmciConfig.getConfig()
.then(async configArg => {
plugins.beautylog.log('Now checking for needed global npm tools...')
for (let npmTool of configArg.globalNpmTools) {
for (let npmTool of configArg.npmGlobalTools) {
plugins.beautylog.info(`Checking for global "${npmTool}"`)
let whichOutput: string = await bashNoError(`which ${npmTool}`)
let toolAvailable: boolean = !((/not\sfound/.test(whichOutput)) || whichOutput === '')

View File

@ -8,16 +8,18 @@ import { repo } from './npmci.env'
import { KeyValueStore } from 'npmextra'
export interface INpmciOptions {
globalNpmTools: string[]
npmGlobalTools: string[]
dockerRegistryRepoMap: any
}
// instantiate a kvStorage for the current directory
export let kvStorage = new KeyValueStore('custom', repo.user + repo.repo)
export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`)
export let getConfig = async (): Promise<INpmciOptions> => {
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
let defaultConfig: INpmciOptions = {
globalNpmTools: []
npmGlobalTools: [],
dockerRegistryRepoMap: {}
}
let npmciConfig = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig)
return npmciConfig