2016-07-04 01:49:24 +00:00
|
|
|
"use strict";
|
2016-11-21 18:34:59 +00:00
|
|
|
const plugins = require("./smartgit.plugins");
|
|
|
|
const helpers = require("./smartgit.helpers");
|
|
|
|
exports.status = (dirPathArg) => {
|
|
|
|
let done = plugins.Q.defer();
|
2016-07-04 01:49:24 +00:00
|
|
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
2016-11-21 18:34:59 +00:00
|
|
|
let err = new Error("smartgit.status expects a valid git directory");
|
2016-07-05 01:47:38 +00:00
|
|
|
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
|
2016-11-21 18:34:59 +00:00
|
|
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
|
2016-07-04 01:49:24 +00:00
|
|
|
done.resolve();
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-11-21 18:34:59 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuc3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuc3RhdHVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw4Q0FBOEM7QUFDOUMsOENBQThDO0FBRW5DLFFBQUEsTUFBTSxHQUFHLENBQUMsVUFBaUI7SUFDbEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLElBQUksR0FBRyxHQUFHLElBQUksS0FBSyxDQUFDLCtDQUErQyxDQUFDLENBQUM7UUFDckUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDakIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUFBLENBQUM7SUFDRix1Q0FBdUM7SUFDdkMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxVQUFVLGlCQUFpQixDQUFDLENBQUM7SUFDekQsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=
|