update to use tapbundle

This commit is contained in:
2017-07-09 19:05:03 +02:00
parent 15e3497c55
commit 3dff5dbbc6
12 changed files with 236 additions and 134 deletions

View File

@ -3,6 +3,9 @@ import * as paths from './npmextra.paths'
export type TKeyValueStore = 'path' | 'gitProject' | 'custom'
/**
* kvStore is a simple key vlaue store to store data about projects between runs
*/
export class KeyValueStore {
type: TKeyValueStore // the type of the kvStore
identity: string // the identity of the kvStore
@ -11,7 +14,7 @@ export class KeyValueStore {
// set kvStoreType
this.type = typeArg
this.identity = customStringArg
this.initIdentity(customStringArg)
this.initFilePath()
}
/**
@ -45,10 +48,10 @@ export class KeyValueStore {
/**
* computes the identity
*/
private initIdentity(customStringArg: string) {
private initFilePath() {
// determine the right base directory
let baseDir: string
if (this.type === 'custom') {
this.identity = customStringArg
baseDir = paths.kvCustomDir
} else if (this.type === 'gitProject') {
baseDir = paths.kvGitDir
@ -59,11 +62,4 @@ export class KeyValueStore {
this.filePath = plugins.path.join(baseDir, this.identity + '.json')
plugins.smartfile.fs.ensureFileSync(this.filePath, '{}')
}
/**
* computes the filePath
*/
private initFilePath() {
}
}

View File

@ -24,7 +24,7 @@ export let kvCustomDir = plugins.path.join(kvBase, 'custom')
export let kvGitDir = plugins.path.join(kvBase, 'git')
/**
* keyValue for path based Key
* keyValue for path based keyValue store
*/
export let kvPathDir = plugins.path.join(kvBase, 'path')