update sshKey detection
This commit is contained in:
parent
6331887373
commit
f0cab00277
8
dist/smartgit.clone.js
vendored
8
dist/smartgit.clone.js
vendored
@ -17,7 +17,11 @@ exports.clone = function (options) {
|
||||
callbacks: {
|
||||
certificateCheck: function () { return 1; },
|
||||
credentials: function (url, userName) {
|
||||
return plugins.nodegit.Cred.sshKeyFromAgent(userName);
|
||||
var gitRepo = new plugins.smartstring.GitRepo(url);
|
||||
var sshDirPath;
|
||||
var pubKey;
|
||||
var privKey;
|
||||
return plugins.nodegit.Cred.sshKeyMemoryNew(userName, pubKey, privKey, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -30,4 +34,4 @@ exports.clone = function (options) {
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNsb25lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDdkIsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUMvQyxJQUFPLGFBQWEsV0FBVyxrQkFBa0IsQ0FBQyxDQUFDO0FBRXhDLGFBQUssR0FBRyxVQUFDLE9BQStCO0lBQy9DLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IseUJBQXlCO0lBQ3pCLGdDQUFnQztJQUVoQywwQkFBMEI7SUFDMUIsRUFBRSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDM0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsK0JBQStCLEdBQUcsT0FBTyxDQUFDLEVBQUUsR0FBRyxtQkFBbUIsQ0FBQyxDQUFDO1FBQzVGLE1B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V5OnN0cmluZztcbiAgICAgICAgICAgICAgICAgICAgbGV0IHByaXZLZXk6c3RyaW5nO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGx1Z2lucy5ub2RlZ2l0LkNyZWQuc3NoS2V5TWVtb3J5TmV3KHVzZXJOYW1lLCBwdWJLZXksIHByaXZLZXksIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgdmFyIGNsb25lUmVwb3NpdG9yeSA9IHBsdWdpbnMubm9kZWdpdC5DbG9uZS5jbG9uZShvcHRpb25zLmZyb20sIG9wdGlvbnMudG8sIGNsb25lT3B0aW9ucylcbiAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgU21hcnRnaXRDaGVjayhjbG9uZVJlcG9zaXRvcnkpO1xuICAgICAgICAgICAgZG9uZS5yZXNvbHZlKCk7XG4gICAgICAgIH0pO1xuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59OyJdfQ==
|
||||
|
6
dist/smartgit.plugins.d.ts
vendored
6
dist/smartgit.plugins.d.ts
vendored
@ -1,5 +1,7 @@
|
||||
import "typings-global";
|
||||
export declare let path: any;
|
||||
export declare let beautylog: any;
|
||||
export import path = require("path");
|
||||
export import beautylog = require("beautylog");
|
||||
export declare let nodegit: any;
|
||||
export declare let Q: any;
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartstring = require("smartstring");
|
||||
|
4
dist/smartgit.plugins.js
vendored
4
dist/smartgit.plugins.js
vendored
@ -4,5 +4,7 @@ exports.path = require("path");
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.nodegit = require("nodegit");
|
||||
exports.Q = require("q");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartstring = require("smartstring");
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmF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sQ0FBQyIsImZpbGUiOiJzbWFydGdpdC5wbHVnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuXG5leHBvcnQgaW1wb3J0IHBhdGggPSByZXF1aXJlKFwicGF0aFwiKTtcbmV4cG9ydCBpbXBvcnQgYmVhdXR5bG9nID0gcmVxdWlyZShcImJlYXV0eWxvZ1wiKTtcbmV4cG9ydCBsZXQgbm9kZWdpdCA9IHJlcXVpcmUoXCJub2RlZ2l0XCIpO1xuZXhwb3J0IGxldCBRID0gcmVxdWlyZShcInFcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0ZmlsZSA9IHJlcXVpcmUoXCJzbWFydGZpbGVcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0c3RyaW5nID0gcmVxdWlyZShcInNtYXJ0c3RyaW5nXCIpO1xuXG5cbiJdfQ==
|
||||
|
@ -26,6 +26,8 @@
|
||||
"beautylog": "^5.0.12",
|
||||
"nodegit": "^0.14.1",
|
||||
"q": "^1.4.1",
|
||||
"smartfile": "^4.0.5",
|
||||
"smartstring": "^2.0.10",
|
||||
"typings-global": "^1.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -19,7 +19,11 @@ export let clone = (options:{from:string,to:string}) => {
|
||||
callbacks: {
|
||||
certificateCheck: function() { return 1; },
|
||||
credentials: function(url, userName) {
|
||||
return plugins.nodegit.Cred.sshKeyFromAgent(userName);
|
||||
let gitRepo = new plugins.smartstring.GitRepo(url);
|
||||
let sshDirPath:string;
|
||||
let pubKey:string;
|
||||
let privKey:string;
|
||||
return plugins.nodegit.Cred.sshKeyMemoryNew(userName, pubKey, privKey, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
import "typings-global"
|
||||
|
||||
export let path = require("path");
|
||||
export let beautylog = require("beautylog");
|
||||
export import path = require("path");
|
||||
export import beautylog = require("beautylog");
|
||||
export let nodegit = require("nodegit");
|
||||
export let Q = require("q");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartstring = require("smartstring");
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user