projectinfo/ts/projectinfo.classes.git.ts

30 lines
686 B
TypeScript
Raw Normal View History

2018-09-02 12:21:05 +00:00
import * as plugins from './projectinfo.plugins';
2016-11-26 13:45:56 +00:00
export class ProjectinfoGit {
2018-09-02 12:21:05 +00:00
isGit: boolean;
githost: string;
gituser: string;
gitrepo: string;
cwd: string;
constructor(cwdArg: string) {
this.cwd = cwdArg;
this.getGitInfoFromPath();
}
2016-11-26 22:18:33 +00:00
2018-09-02 12:21:05 +00:00
/**
* get git info from path
*/
getGitInfoFromPath() {
let localSmartpath = new plugins.smartpath.Smartpath(this.cwd);
this.gitrepo = localSmartpath.pathLevelsBackwards[0];
this.gituser = localSmartpath.pathLevelsBackwards[1];
}
2016-11-26 22:18:33 +00:00
2018-09-02 12:21:05 +00:00
/**
* get git info from remote url
*/
getGitInfoFromRemote(remoteUrlArg: string) {
let gitRepoParsed = new plugins.smartstring.GitRepo(remoteUrlArg);
}
2016-11-26 22:18:33 +00:00
}