2016-06-12 14:46:59 +00:00
|
|
|
"use strict";
|
2016-11-21 18:34:59 +00:00
|
|
|
const plugins = require("./smartgit.plugins");
|
|
|
|
const helpers = require("./smartgit.helpers");
|
|
|
|
let addAll = (dirPathArg) => {
|
|
|
|
let done = plugins.Q.defer();
|
2016-07-03 02:37:03 +00:00
|
|
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
2016-11-21 18:34:59 +00:00
|
|
|
let err = new Error("smartgit.add expects a valid git directory!");
|
2016-07-05 01:47:38 +00:00
|
|
|
plugins.beautylog.error(err.message);
|
|
|
|
done.reject(err);
|
2016-07-03 02:37:03 +00:00
|
|
|
return done.promise;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
// if everything is ok proceed
|
2016-11-21 18:34:59 +00:00
|
|
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git add -A && git status)`);
|
2016-07-03 02:37:03 +00:00
|
|
|
done.resolve(dirPathArg);
|
|
|
|
return done.promise;
|
2016-06-25 17:13:19 +00:00
|
|
|
};
|
2016-07-03 22:00:04 +00:00
|
|
|
exports.add = {
|
|
|
|
addAll: addAll
|
|
|
|
};
|
2016-11-21 18:34:59 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw4Q0FBOEM7QUFDOUMsOENBQThDO0FBRTlDLElBQUksTUFBTSxHQUFHLENBQUMsVUFBaUI7SUFDM0IsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLElB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