new implementation

This commit is contained in:
2016-07-03 04:37:03 +02:00
parent 011ac2d7b4
commit 5d00afcdf0
16 changed files with 76 additions and 16 deletions

View File

@ -1,7 +1,9 @@
import plugins = require("./smartgit.plugins");
export {add} from "./smartgit.add";
export {clone} from "./smartgit.clone";
export {commit} from "./smartgit.commit";
export {init} from "./smartgit.init";
export {pull} from "./smartgit.pull";
export {push} from "./smartgit.push";
export {remote} from "./smartgit.remote";

View File

@ -1,5 +1,15 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let pull = (optionsArg:{path:string,ref?:string}) => {
}
export let add = (dirPathArg:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.add expects a valif git directory!");
done.reject();
return done.promise;
};
// if everything is ok proceed
plugins.shelljs.exec("");
done.resolve(dirPathArg);
return done.promise;
};

View File

@ -3,7 +3,7 @@ import * as helpers from "./smartgit.helpers";
export let commit = (dirPathArg:string,commitMessage:string) => {
let done = plugins.Q.defer();
if(!plugins.smartfile.fs.isDirectory(plugins.path.join(dirPathArg,".git"))){
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.commit expects a valid git directory");
done.reject();
return done.promise;

View File

@ -1,5 +1,6 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let pull = (dirPathArg:string,sourceArg:string = "", branchArg:string = "") => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){

View File

@ -0,0 +1,16 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
let addRemote = (dirPathArg) => {
let done = plugins.Q.defer();
};
let removeRemote = () => {
}
export let remote = {
add: addRemote,
remove: removeRemote
}