smartgit/ts/smartgit.status.ts

16 lines
558 B
TypeScript
Raw Normal View History

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