2015-11-09 21:58:43 +00:00
|
|
|
/// <reference path="typings/tsd.d.ts" />
|
2015-11-13 21:58:20 +00:00
|
|
|
/// <reference path="smartgit.clone.ts" />
|
|
|
|
/// <reference path="smartgit.init.ts" />
|
|
|
|
/// <reference path="smartgit.commit.ts" />
|
2015-11-11 04:20:06 +00:00
|
|
|
|
2015-11-13 21:58:20 +00:00
|
|
|
var plugins = {
|
|
|
|
path: require("path"),
|
|
|
|
beautylog: require("beautylog")("os"),
|
|
|
|
nodegit: require("nodegit"),
|
|
|
|
Q: require("q")
|
|
|
|
};
|
2015-11-11 04:20:06 +00:00
|
|
|
|
|
|
|
|
2015-11-13 21:58:20 +00:00
|
|
|
var smartgit:any = {};
|
2015-11-11 04:20:06 +00:00
|
|
|
|
2015-11-13 21:58:20 +00:00
|
|
|
smartgit.clone = SmartgitClone
|
2015-11-11 04:20:06 +00:00
|
|
|
|
2015-11-13 21:58:20 +00:00
|
|
|
smartgit.commit = function(pathArg:string,commitMessage:string) {
|
|
|
|
var result = plugins.nodegit.index.addByPath(pathArg);
|
|
|
|
if (result == 0) {
|
|
|
|
|
|
|
|
}
|
2015-11-09 21:58:43 +00:00
|
|
|
};
|
|
|
|
|
2015-11-11 04:20:06 +00:00
|
|
|
smartgit.init = function(dest:string = "undefined") {
|
|
|
|
if (dest == "undefined") { //lets check if a destination is defined...
|
|
|
|
return; // ...and return function here if not
|
|
|
|
}
|
|
|
|
var isBare = 0; //lets create a subfolder
|
2015-11-13 21:58:20 +00:00
|
|
|
plugins.nodegit.Repository.init(dest, isBare).then(function (repo) {
|
2015-11-11 04:20:06 +00:00
|
|
|
// do something with repo here.
|
|
|
|
});
|
|
|
|
};
|
2015-11-09 21:58:43 +00:00
|
|
|
|
2015-11-13 21:58:20 +00:00
|
|
|
smartgit.check = function(repository) {
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-11 04:20:06 +00:00
|
|
|
module.exports = smartgit;
|