smartgit/ts/smartgit.add.ts

16 lines
478 B
TypeScript
Raw Normal View History

2016-06-12 14:46:59 +00:00
import * as plugins from "./smartgit.plugins";
2016-07-03 02:37:03 +00:00
import * as helpers from "./smartgit.helpers";
2016-06-12 14:46:59 +00:00
2016-07-03 02:37:03 +00:00
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;
};