now using native git through shelljs since it proves to be much more stable

This commit is contained in:
Philipp Kunz 2016-07-02 02:22:03 +02:00
parent 527d1b7aa5
commit c8c9d8a407
24 changed files with 56 additions and 132 deletions

View File

@ -1,5 +1,5 @@
# smartgit is an easy wrapper for nodegit
an easy wrapper for nodegit
a wrapper for git. This plugin does not use nodegit as nodegit appears to have too many bugs for now.
### Buildstatus/Dependencies
[![build status](https://gitlab.com/pushrocks/smartgit/badges/master/build.svg)](https://gitlab.com/pushrocks/smartgit/commits/master)

3
dist/index.js vendored
View File

@ -2,5 +2,4 @@
require("typings-global");
var smartgit_clone_1 = require("./smartgit.clone");
exports.clone = smartgit_clone_1.clone;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUVQLENBQUMsQ0FGc0I7QUFJdkIsK0JBQW9CLGtCQUFrQixDQUFDO0FBQS9CLHVDQUErQiIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcblxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuaW1wb3J0IFNtYXJ0Z2l0Q2hlY2sgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5jaGVja1wiKTtcbmV4cG9ydCB7Y2xvbmV9IGZyb20gXCIuL3NtYXJ0Z2l0LmNsb25lXCI7XG5pbXBvcnQgU21hcnRnaXRDb21taXQgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5jb21taXRcIik7XG5pbXBvcnQgU21hcnRnaXRJbml0ID0gcmVxdWlyZShcIi4vc21hcnRnaXQuaW5pdFwiKTtcblxuXG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFFUCxDQUFDLENBRnNCO0FBSXZCLCtCQUFvQixrQkFBa0IsQ0FBQztBQUEvQix1Q0FBK0IifQ==

0
dist/postinstall.d.ts vendored Normal file
View File

2
dist/postinstall.js vendored Normal file
View File

@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdGluc3RhbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wb3N0aW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=

View File

@ -1,10 +1,5 @@
"use strict";
require("typings-global");
var plugins = require("./smartgit.plugins");
exports.pull = function (optionsArg) {
if (!optionsArg.ref)
optionsArg.ref = "master";
plugins.nodegit.Repository.open(optionsArg.path);
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmFkZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsWUFBSSxHQUFHLFVBQUMsVUFBb0M7SUFDbkQsRUFBRSxDQUFBLENBQUMsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDO1FBQUMsVUFBVSxDQUFDLEdBQUcsR0FBRyxRQUFRLENBQUM7SUFDOUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNyRCxDQUFDLENBQUEiLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vc21hcnRnaXQucGx1Z2luc1wiO1xuXG5leHBvcnQgbGV0IHB1bGwgPSAob3B0aW9uc0FyZzp7cGF0aDpzdHJpbmcscmVmPzpzdHJpbmd9KSA9PiB7XG4gICAgaWYoIW9wdGlvbnNBcmcucmVmKSBvcHRpb25zQXJnLnJlZiA9IFwibWFzdGVyXCI7XG4gICAgcGx1Z2lucy5ub2RlZ2l0LlJlcG9zaXRvcnkub3BlbihvcHRpb25zQXJnLnBhdGgpO1xufVxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHYixZQUFJLEdBQUcsVUFBQyxVQUFvQztBQUV2RCxDQUFDLENBQUEifQ==

View File

@ -3,5 +3,4 @@ require("typings-global");
module.exports = function (repoArg) {
return true;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNoZWNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFFdkIsaUJBQVMsVUFBUyxPQUFPO0lBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUM7QUFDaEIsQ0FBQyxDQUFDIiwiZmlsZSI6InNtYXJ0Z2l0LmNoZWNrLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuZXhwb3J0ID0gZnVuY3Rpb24ocmVwb0FyZykge1xuICAgIHJldHVybiB0cnVlO1xufTsiXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY2hlY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGdpdC5jaGVjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBRXZCLGlCQUFTLFVBQVMsT0FBTztJQUNyQixNQUFNLENBQUMsSUFBSSxDQUFDO0FBQ2hCLENBQUMsQ0FBQyJ9

View File

@ -2,6 +2,7 @@ import "typings-global";
export declare let clone: (optionsArg: {
from: string;
to: string;
key?: string;
keyPath?: string;
keyPassphrase?: string;
}) => any;

View File

@ -1,42 +1,11 @@
"use strict";
require("typings-global");
var plugins = require("./smartgit.plugins");
var SmartgitCheck = require("./smartgit.check");
exports.clone = function (optionsArg) {
var done = plugins.Q.defer();
/***** URL Checks ******/
//TODO make smartstring URL test
/***** Path Checks ******/
if (!/^\/.*/.test(optionsArg.to)) {
plugins.beautylog.error("It seems that the given path " + optionsArg.to + " is not absolute.");
return;
}
plugins.beautylog.log("Now cloning " + optionsArg.from);
var cloneOptions = {
fetchOpts: {
callbacks: {
certificateCheck: function () { return 1; },
credentials: function (url, userName) {
var gitRepo = new plugins.smartstring.GitRepo(url);
var host = gitRepo.host;
var sshDir = plugins.path.join(plugins.smartpath.get.home(), ".ssh/");
var pubKeyPath = plugins.path.join(sshDir, host + ".pub");
var privKeyPath = plugins.path.join(sshDir, host);
if (!optionsArg.keyPassphrase)
optionsArg.keyPassphrase = "";
return plugins.nodegit.Cred.sshKeyNew(userName, pubKeyPath, privKeyPath, optionsArg.keyPassphrase);
}
}
}
};
var cloneRepository = plugins.nodegit.Clone.clone(optionsArg.from, optionsArg.to, cloneOptions)
.then(function () {
SmartgitCheck(cloneRepository);
plugins.smartfile.fs.ensureDir(optionsArg.to);
plugins.shelljs.exec("cd " + optionsArg.to + " && git clone " + optionsArg.from + " .");
done.resolve();
}, function (err) {
console.log(err);
});
return done.promise;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNsb25lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDdkIsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUMvQyxJQUFPLGFBQWEsV0FBVyxrQkFBa0IsQ0FBQyxDQUFDO0FBRXhDLGFBQUssR0FBRyxVQUFDLFVBS2Y7SUFDRCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLHlCQUF5QjtJQUN6QixnQ0FBZ0M7SUFFaEMsMEJBQTBCO0lBQzFCLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQzlCLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLCtCQUErQixHQUFHLFVBQVUsQ0FBQyxFQUFFLEdBQUcsbUJBQW1CLENBQUMsQ0FBQztRQUMvRixNQUFNLENBQUM7SUFDWCxDQUFDO0lBRUQsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsY0FBYyxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUN4RCxJQUFJLFlBQVksR0FBTztRQUNuQixTQUFTLEVBQUU7WUFDUCxTQUFTLEVBQUU7Z0JBQ1AsZ0JBQWdCLEVBQUUsY0FBYSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDMUMsV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udG8gKyBcIiBpcyBub3QgYWJzb2x1dGUuXCIpO1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgcGx1Z2lucy5iZWF1dHlsb2cubG9nKFwiTm93IGNsb25pbmcgXCIgKyBvcHRpb25zQXJnLmZyb20pO1xuICAgIHZhciBjbG9uZU9wdGlvbnM6YW55ID0ge1xuICAgICAgICBmZXRjaE9wdHM6IHtcbiAgICAgICAgICAgIGNhbGxiYWNrczoge1xuICAgICAgICAgICAgICAgIGNlcnRpZmljYXRlQ2hlY2s6IGZ1bmN0aW9uKCkgeyByZXR1cm4gMTsgfSxcbiAgICAgICAgICAgICAgICBjcmVkZW50aWFsczogZnVuY3Rpb24odXJsLCB1c2VyTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZ2l0UmVwbyA9IG5ldyBwbHVnaW5zLnNtYXJ0c3RyaW5nLkdpdFJlcG8odXJsKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSBnaXRSZXBvLmhvc3Q7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzc2hEaXIgPSBwbHVnaW5zLnBhdGguam9pbihwbHVnaW5zLnNtYXJ0cGF0aC5nZXQuaG9tZSgpLFwiLnNzaC9cIilcbiAgICAgICAgICAgICAgICAgICAgbGV0IHB1YktleVBhdGggPSBwbHVnaW5zLnBhdGguam9pbihzc2hEaXIsaG9zdCArIFwiLnB1YlwiKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHByaXZLZXlQYXRoOnN0cmluZyA9IHBsdWdpbnMucGF0aC5qb2luKHNzaERpcixob3N0KTtcbiAgICAgICAgICAgICAgICAgICAgaWYoIW9wdGlvbnNBcmcua2V5UGFzc3BocmFzZSkgb3B0aW9uc0FyZy5rZXlQYXNzcGhyYXNlID0gXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsdWdpbnMubm9kZWdpdC5DcmVkLnNzaEtleU5ldyh1c2VyTmFtZSwgcHViS2V5UGF0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FDLElBQUksT0FBSSxDQUFDLENBQUM7SUFDOUUsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=

View File

@ -1,3 +1,3 @@
import "typings-global";
declare var _default: (pathArg: string, commitMessage: string) => void;
declare var _default: (pathArg: string, commitMessage: string) => any;
export = _default;

View File

@ -2,9 +2,8 @@
require("typings-global");
var plugins = require("./smartgit.plugins");
module.exports = function (pathArg, commitMessage) {
var result = plugins.nodegit.index.addByPath(pathArg);
if (result == 0) {
}
var done = plugins.Q.defer();
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNvbW1pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBQ3ZCLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFL0MsaUJBQVMsVUFBUyxPQUFjLEVBQUMsYUFBb0I7SUFDakQsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3RELEVBQUUsQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRWxCLENBQUM7QUFDTCxDQUFDLENBQUMiLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuXG5leHBvcnQgPSBmdW5jdGlvbihwYXRoQXJnOnN0cmluZyxjb21taXRNZXNzYWdlOnN0cmluZykge1xuICAgIHZhciByZXN1bHQgPSBwbHVnaW5zLm5vZGVnaXQuaW5kZXguYWRkQnlQYXRoKHBhdGhBcmcpO1xuICAgIGlmIChyZXN1bHQgPT0gMCkge1xuICAgICAgICBcbiAgICB9XG59OyJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuY29tbWl0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDdkIsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUUvQyxpQkFBUyxVQUFTLE9BQWMsRUFBQyxhQUFvQjtJQUNqRCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9

View File

@ -1,17 +1,11 @@
"use strict";
require("typings-global");
var plugins = require("./smartgit.plugins");
module.exports = function () {
var gitinit = function (dest) {
if (dest === void 0) { dest = "undefined"; }
if (dest == "undefined") {
return; // ...and return function here if not
}
var isBare = 0; //lets create a subfolder
plugins.nodegit.Repository.init(dest, isBare).then(function (repo) {
// do something with repo here.
});
};
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQ1AsQ0FBQyxDQURzQjtBQUN2QixJQUFPLE9BQU8sV0FBVyxvQkFBb0IsQ0FBQyxDQUFDO0FBRS9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QoZGVzdCwgaXNCYXJlKS50aGVuKGZ1bmN0aW9uIChyZXBvKSB7XG4gICAgICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCByZXBvIGhlcmUuXG4gICAgICAgIH0pO1xuICAgIH07XG59Il19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQ1AsQ0FBQyxDQURzQjtBQUd2QixpQkFBUztJQUNMLElBQUksT0FBTyxHQUFHLFVBQVMsSUFBeUI7UUFBekIsb0JBQXlCLEdBQXpCLGtCQUF5QjtRQUM1QyxFQUFFLENBQUMsQ0FBQyxJQUFJLElBQUksV0FBVyxDQUFDLENBQUMsQ0FBQztZQUN0QixNQUFNLENBQUMsQ0FBQyxxQ0FBcUM7UUFDakQsQ0FBQztJQUdMLENBQUMsQ0FBQztBQUNOLENBQUMsQ0FBQSJ9

View File

@ -1,4 +1,3 @@
"use strict";
require("typings-global");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBRCIsImZpbGUiOiJzbWFydGdpdC5pbnRlcmZhY2VzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBRCJ9

View File

@ -1,8 +1,8 @@
import "typings-global";
export import path = require("path");
export import beautylog = require("beautylog");
export declare let nodegit: any;
export declare let Q: any;
export declare let shelljs: any;
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");
export import smartstring = require("smartstring");

View File

@ -2,10 +2,9 @@
require("typings-global");
exports.path = require("path");
exports.beautylog = require("beautylog");
exports.nodegit = require("nodegit");
exports.Q = require("q");
exports.shelljs = require("shelljs");
exports.smartfile = require("smartfile");
exports.smartpath = require("smartpath");
exports.smartstring = require("smartstring");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBRVAsQ0FBQyxDQUZzQjtBQUVULFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ3BDLGVBQU8sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDN0IsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNkLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsaUJBQVMsV0FBVyxXQUFXLENBQUMsQ0FBQztBQUNqQyxtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDIiwiZmlsZSI6InNtYXJ0Z2l0LnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCJ0eXBpbmdzLWdsb2JhbFwiXG5cbmV4cG9ydCBpbXBvcnQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuZXhwb3J0IGltcG9ydCBiZWF1dHlsb2cgPSByZXF1aXJlKFwiYmVhdXR5bG9nXCIpO1xuZXhwb3J0IGxldCBub2RlZ2l0ID0gcmVxdWlyZShcIm5vZGVnaXRcIik7XG5leHBvcnQgbGV0IFEgPSByZXF1aXJlKFwicVwiKTtcbmV4cG9ydCBpbXBvcnQgc21hcnRmaWxlID0gcmVxdWlyZShcInNtYXJ0ZmlsZVwiKTtcbmV4cG9ydCBpbXBvcnQgc21hcnRwYXRoID0gcmVxdWlyZShcInNtYXJ0cGF0aFwiKTtcbmV4cG9ydCBpbXBvcnQgc21hcnRzdHJpbmcgPSByZXF1aXJlKFwic21hcnRzdHJpbmdcIik7XG5cblxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBRVAsQ0FBQyxDQUZzQjtBQUVULFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ3BDLFNBQUMsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDakIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMxQixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsbUJBQVcsV0FBVyxhQUFhLENBQUMsQ0FBQyJ9

View File

@ -1,3 +1 @@
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzbWFydGdpdC5wdWxsLmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1bGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@ -5,7 +5,9 @@
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
"cleanTest":"rm -rf test/temp && rm -rf test/temp2",
"test": "(npm run cleanTest && npmts)",
"install": "node dist/postinstall.js"
},
"repository": {
"type": "git",
@ -23,13 +25,15 @@
},
"homepage": "https://github.com/pushrocks/smartgit",
"dependencies": {
"beautylog": "^5.0.12",
"nodegit": "^0.14.1",
"@types/minimatch": "*",
"@types/shelljs": "^0.3.23-alpha",
"beautylog": "^5.0.13",
"q": "^1.4.1",
"smartfile": "^4.0.5",
"shelljs": "^0.7.0",
"smartfile": "^4.0.10",
"smartpath": "^3.2.2",
"smartstring": "^2.0.10",
"typings-global": "^1.0.3"
"typings-global": "^1.0.5"
},
"devDependencies": {
"npmts-g": "^5.2.6",

View File

@ -6,7 +6,7 @@ var smartgit = require("../dist/index");
describe("smartgit", function () {
describe(".clone", function () {
it("should clone a repository using ssh and sshkey", function (done) {
this.timeout(10000);
this.timeout(20000);
smartgit.clone({
from: "git@gitlab.com:sandboxzone/sandbox-testrepo.git",
to: path.resolve("./test/temp/")
@ -15,7 +15,7 @@ describe("smartgit", function () {
});
});
it("should clone a repository using https", function (done) {
this.timeout(10000);
this.timeout(20000);
smartgit.clone({
from: "https://gitlab.com/sandboxzone/sandbox-testrepo.git",
to: path.resolve("./test/temp2/")
@ -31,5 +31,4 @@ describe("smartgit", function () {
describe("init", function () {
});
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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QUNYLElBQUksRUFBQyxpREFBaUQ7Z0JBQ3RELEVBQUUsRUFBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQzthQUNsQyxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUNKLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDLENBQUMsQ0FBQztRQUNILEVBQUUsQ0FBQyx1Q0FBdUMsRUFBQyxVQUFTLElBQUk7WUFDcEQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNwQixRQUFRLENBQUMsS0FBSyxDQUFDO2dCQUNYLElBQUksRUFBQyxxREFBcUQ7Z0JBQzFELEVBQUUsRUFBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGVBQWUsQ0FBQzthQUNuQyxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUNKLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDO0lBQ0gsUUFBUSxDQUFDLFFBQVEsRUFBQztJQUVsQixDQUFDLENBQUMsQ0FBQztJQUNILFFBQVEsQ0FBQyxRQUFRLEVBQUM7SUFFbEIsQ0FBQyxDQUFDLENBQUM7SUFDSCxRQUFRLENBQUMsTUFBTSxFQUFDO0lBRWhCLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMifQ==

View File

@ -8,7 +8,7 @@ import smartgit = require("../dist/index");
describe("smartgit",function(){
describe(".clone",function(){
it("should clone a repository using ssh and sshkey",function(done){
this.timeout(10000);
this.timeout(20000);
smartgit.clone({
from:"git@gitlab.com:sandboxzone/sandbox-testrepo.git",
to:path.resolve("./test/temp/")
@ -17,7 +17,7 @@ describe("smartgit",function(){
});
});
it("should clone a repository using https",function(done){
this.timeout(10000);
this.timeout(20000);
smartgit.clone({
from:"https://gitlab.com/sandboxzone/sandbox-testrepo.git",
to:path.resolve("./test/temp2/")

2
ts/postinstall.ts Normal file
View File

@ -0,0 +1,2 @@
import shelljs = require("shelljs");
import beautylog = require("beautylog");

View File

@ -2,6 +2,5 @@ import "typings-global";
import * as plugins from "./smartgit.plugins";
export let pull = (optionsArg:{path:string,ref?:string}) => {
if(!optionsArg.ref) optionsArg.ref = "master";
plugins.nodegit.Repository.open(optionsArg.path);
}

View File

@ -5,42 +5,13 @@ import SmartgitCheck = require("./smartgit.check");
export let clone = (optionsArg: {
from: string,
to: string,
key?: string,
keyPath?: string,
keyPassphrase?: string
}) => {
let done = plugins.Q.defer();
/***** URL Checks ******/
//TODO make smartstring URL test
/***** Path Checks ******/
if (!/^\/.*/.test(optionsArg.to)){ //check wether path is absolute
plugins.beautylog.error("It seems that the given path " + optionsArg.to + " is not absolute.");
return;
}
plugins.beautylog.log("Now cloning " + optionsArg.from);
var cloneOptions:any = {
fetchOpts: {
callbacks: {
certificateCheck: function() { return 1; },
credentials: function(url, userName) {
let gitRepo = new plugins.smartstring.GitRepo(url);
let host = gitRepo.host;
let sshDir = plugins.path.join(plugins.smartpath.get.home(),".ssh/")
let pubKeyPath = plugins.path.join(sshDir,host + ".pub");
let privKeyPath:string = plugins.path.join(sshDir,host);
if(!optionsArg.keyPassphrase) optionsArg.keyPassphrase = "";
return plugins.nodegit.Cred.sshKeyNew(userName, pubKeyPath, privKeyPath,optionsArg.keyPassphrase);
}
}
}
};
var cloneRepository = plugins.nodegit.Clone.clone(optionsArg.from, optionsArg.to, cloneOptions)
.then(() => {
SmartgitCheck(cloneRepository);
plugins.smartfile.fs.ensureDir(optionsArg.to);
plugins.shelljs.exec(`cd ${optionsArg.to} && git clone ${optionsArg.from} .`);
done.resolve();
},(err) => {
console.log(err);
});
return done.promise;
};

View File

@ -2,8 +2,7 @@ import "typings-global"
import plugins = require("./smartgit.plugins");
export = function(pathArg:string,commitMessage:string) {
var result = plugins.nodegit.index.addByPath(pathArg);
if (result == 0) {
}
let done = plugins.Q.defer();
done.resolve();
return done.promise;
};

View File

@ -6,9 +6,7 @@ export = function(){
if (dest == "undefined") { //lets check if a destination is defined...
return; // ...and return function here if not
}
var isBare = 0; //lets create a subfolder
plugins.nodegit.Repository.init(dest, isBare).then(function (repo) {
// do something with repo here.
});
};
}

View File

@ -2,10 +2,8 @@ import "typings-global"
export import path = require("path");
export import beautylog = require("beautylog");
export let nodegit = require("nodegit");
export let Q = require("q");
export let shelljs = require("shelljs");
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");
export import smartstring = require("smartstring");