added ProjectInfo main class

This commit is contained in:
2016-11-26 23:18:33 +01:00
parent 481ab58d02
commit c17db19b9f
12 changed files with 83 additions and 26 deletions

View File

@@ -1,8 +1,29 @@
import 'typings-global'
import * as plugins from './projectinfo.plugins'
export class ProjectinfoGit {
isGit: boolean
constructor() {
githost: string
gituser: string
gitrepo: string
cwd: string
constructor(cwdArg: string) {
this.cwd = cwdArg
this.getGitInfoFromPath()
}
}
/**
* get git info from path
*/
getGitInfoFromPath() {
let localSmartpath = new plugins.smartpath.Smartpath(this.cwd)
this.gitrepo = localSmartpath.pathLevelsBackwards[0]
this.gituser = localSmartpath.pathLevelsBackwards[1]
}
/**
* get git info from remote url
*/
getGitInfoFromRemote(remoteUrlArg: string) {
let gitRepoParsed = new plugins.smartstring.GitRepo(remoteUrlArg)
}
}