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