2016-06-12 14:46:59 +00:00
|
|
|
"use strict";
|
2016-07-03 02:37:03 +00:00
|
|
|
var plugins = require("./smartgit.plugins");
|
|
|
|
var helpers = require("./smartgit.helpers");
|
2016-07-03 22:00:04 +00:00
|
|
|
var addAll = function (dirPathArg) {
|
2016-07-03 02:37:03 +00:00
|
|
|
var done = plugins.Q.defer();
|
|
|
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
2016-07-03 22:00:04 +00:00
|
|
|
plugins.beautylog.error("smartgit.add expects a valid git directory!");
|
2016-07-03 02:37:03 +00:00
|
|
|
done.reject();
|
|
|
|
return done.promise;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
// if everything is ok proceed
|
2016-07-03 22:00:04 +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
|
|
|
|
};
|
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQzlDLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFOUMsSUFBSSxNQUFNLEdBQUcsVUFBQyxVQUFpQjtJQUMzQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQy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