2016-03-30 23:59:45 +00:00
|
|
|
"use strict";
|
2016-07-03 02:03:15 +00:00
|
|
|
var plugins = require("./smartgit.plugins");
|
|
|
|
exports.init = function (dirPathArg) {
|
|
|
|
var done = plugins.Q.defer();
|
|
|
|
if (typeof dirPathArg == "undefined") {
|
2016-07-05 01:47:38 +00:00
|
|
|
var err = new Error("smartgit.init requires an absolute directory path!");
|
|
|
|
plugins.beautylog.error(err.message);
|
|
|
|
done.reject("err");
|
|
|
|
return done.promise;
|
2016-07-03 02:03:15 +00:00
|
|
|
}
|
|
|
|
;
|
|
|
|
plugins.smartfile.fs.ensureDir(dirPathArg);
|
|
|
|
plugins.shelljs.exec("(cd " + dirPathArg + " && git init)");
|
|
|
|
done.resolve(dirPathArg);
|
|
|
|
return done.promise;
|
2016-03-30 23:59:45 +00:00
|
|
|
};
|
2016-07-05 01:47:38 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFcEMsWUFBSSxHQUFHLFVBQUMsVUFBaUI7SUFDaEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUMsQ0FBQyxPQUFPLFVBQVUsSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ25DLElBQUksR0FBRyxHQUFHLElBQUksS0FBSyxDQUFDLG9EQUFvRCxDQUFDLENBQUE7UUFDekUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLElBQUksQ0FBQy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