add git module and kvStore

This commit is contained in:
2017-08-28 17:11:47 +02:00
parent 10cc7cf581
commit 5eb07f1ad7
12 changed files with 92 additions and 2 deletions

24
ts/mod_git/index.ts Normal file
View File

@ -0,0 +1,24 @@
import * as plugins from './mod.plugins'
/**
* handle cli input
* @param argvArg
*/
export let handleCli = async (argvArg) => {
if (argvArg._.length >= 2) {
let action: string = argvArg._[ 1 ]
switch (action) {
case 'mirror':
await mirror()
break
default:
plugins.beautylog.error(`>>npmci git ...<< action >>${action}<< not supported`)
}
} else {
plugins.beautylog.log(`>>npmci git ...<< cli arguments invalid... Please read the documentation.`)
}
}
export let mirror = async () => {
}

View File

@ -0,0 +1 @@
export * from '../npmci.plugins'

View File

@ -3,10 +3,17 @@ import * as q from 'q'
import * as plugins from './npmci.plugins'
import * as paths from './npmci.paths'
import { repo } from './npmci.env'
import { KeyValueStore } from 'npmextra'
export interface INpmciOptions {
globalNpmTools: string[]
}
// instantiate a kvStorage for the current directory
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 = {

View File

@ -2,6 +2,7 @@ import * as _modClean from './mod_clean/index'
import * as _modCloudflare from './mod_cloudflare/index'
import * as _modCommand from './mod_command/index'
import * as _modDocker from './mod_docker/index'
import * as _modGit from './mod_git/index'
import * as _modNpm from './mod_npm/index'
import * as _modNode from './mod_node/index'
import * as _modSsh from './mod_ssh/index'
@ -12,6 +13,7 @@ import { LazyModule } from 'smartsystem'
export let modClean = new LazyModule<typeof _modClean>('./mod_clean/index', __dirname)
export let modCloudflare = new LazyModule<typeof _modCloudflare>('./mod_cloudflare/index', __dirname)
export let modCommand = new LazyModule<typeof _modCommand>('./mod_command/index', __dirname)
export let modGit = new LazyModule<typeof _modGit>('./mod_git/index', __dirname)
export let modDocker = new LazyModule<typeof _modDocker>('./mod_docker/index', __dirname)
export let modNode = new LazyModule<typeof _modNode>('./mod_node/index', __dirname)
export let modNpm = new LazyModule<typeof _modNpm>('./mod_npm/index', __dirname)