smartgit/ts/smartgit.push.ts

15 lines
554 B
TypeScript
Raw Normal View History

2016-07-03 02:03:15 +00:00
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string = "") => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.push expects a valid git directory");
done.reject();
return done.promise;
}
// if everything seems allright proceed
2016-07-04 01:49:24 +00:00
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
2016-07-03 02:03:15 +00:00
done.resolve();
return done.promise;
};