update base structure

This commit is contained in:
Philipp Kunz 2016-06-12 16:46:59 +02:00
parent c4958baf52
commit 53a5a3a805
33 changed files with 138 additions and 84 deletions

2
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import "typings-global";
export { clone } from "./smartgit.clone";

16
dist/index.js vendored
View File

@ -1,14 +1,6 @@
/// <reference path="./typings/main.d.ts" />
"use strict"; "use strict";
var SmartgitCheck = require("./smartgit.check"); require("typings-global");
var SmartgitClone = require("./smartgit.clone"); var smartgit_clone_1 = require("./smartgit.clone");
var SmartgitCommit = require("./smartgit.commit"); exports.clone = smartgit_clone_1.clone;
var SmartgitInit = require("./smartgit.init");
var smartgit = {};
smartgit.clone = SmartgitClone;
smartgit.commit = SmartgitCommit;
smartgit.check = SmartgitCheck;
smartgit.init = SmartgitInit;
module.exports = smartgit;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFHNUMsSUFBTyxhQUFhLFdBQVcsa0JBQWtCLENBQUMsQ0FBQztBQUNuRCxJQUFPLGFBQWEsV0FBVyxrQkFBa0IsQ0FBQyxDQUFDO0FBQ25ELElBQU8sY0FBYyxXQUFXLG1CQUFtQixDQUFDLENBQUM7QUFDckQsSUFBTyxZQUFZLFdBQVcsaUJBQWlCLENBQUMsQ0FBQztBQUVqRCxJQUFJLFFBQVEsR0FBTyxFQUFFLENBQUM7QUFDdEIsUUFBUSxDQUFDLEtBQUssR0FBRyxhQUFhLENBQUM7QUFDL0IsUUFBUSxDQUFDLE1BQU0sR0FBRyxjQUFjLENBQUM7QUFDakMsUUFBUSxDQUFDLEtBQUssR0FBRyxhQUFhLENBQUM7QUFDL0IsUUFBUSxDQUFDLElBQUksR0FBRyxZQUFZLENBQUM7QUFHN0IsTUFBTSxDQUFDLE9BQU8sR0FBRyxRQUFRLENBQUMiLCJmaWxlIjoia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gPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuaW1wb3J0IFNtYXJ0Z2l0Q2hlY2sgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5jaGVja1wiKTtcbmV4cG9ydCB7Y2xvbmV9IGZyb20gXCIuL3NtYXJ0Z2l0LmNsb25lXCI7XG5pbXBvcnQgU21hcnRnaXRDb21taXQgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5jb21taXRcIik7XG5pbXBvcnQgU21hcnRnaXRJbml0ID0gcmVxdWlyZShcIi4vc21hcnRnaXQuaW5pdFwiKTtcblxuXG4iXX0=

1
dist/smartgit.add.d.ts vendored Normal file
View File

@ -0,0 +1 @@
import "typings-global";

View File

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

3
dist/smartgit.check.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import "typings-global";
declare var _default: (repoArg: any) => boolean;
export = _default;

View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
require("typings-global");
module.exports = function (repoArg) { module.exports = function (repoArg) {
return true; return true;
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNoZWNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSxpQkFBUyxVQUFTLE9BQU87SUFDckIsTUFBTSxDQUFDLElBQUksQ0FBQztBQUNoQixDQUFDLENBQUMiLCJmaWxlIjoic21hcnRnaXQuY2hlY2suanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgcGx1Z2lucyA9IHJlcXVpcmUoXCIuL3NtYXJ0Z2l0LnBsdWdpbnNcIik7XG5leHBvcnQgPSBmdW5jdGlvbihyZXBvQXJnKSB7XG4gICAgcmV0dXJuIHRydWU7XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNoZWNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFFdkIsaUJBQVMsVUFBUyxPQUFPO0lBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUM7QUFDaEIsQ0FBQyxDQUFDIiwiZmlsZSI6InNtYXJ0Z2l0LmNoZWNrLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuZXhwb3J0ID0gZnVuY3Rpb24ocmVwb0FyZykge1xuICAgIHJldHVybiB0cnVlO1xufTsiXX0=

5
dist/smartgit.clone.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import "typings-global";
export declare let clone: (options: {
from: string;
to: string;
}) => any;

View File

@ -1,25 +1,33 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> require("typings-global");
var plugins = require("./smartgit.plugins"); var plugins = require("./smartgit.plugins");
var SmartgitCheck = require("./smartgit.check"); var SmartgitCheck = require("./smartgit.check");
module.exports = function (options) { exports.clone = function (options) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
/***** URL Checks ******/ /***** URL Checks ******/
if (options.from == "undefined" || options.to == "undefined") { //TODO make smartstring URL test
plugins.beautylog.error("smartgit.clone".blue + " : Something is strange about the way you invoked the function");
return;
}
/***** Path Checks ******/ /***** Path Checks ******/
if (!/^\/.*/.test(options.to)) { if (!/^\/.*/.test(options.to)) {
plugins.beautylog.error("It seems that the given path " + options.to + " is not absolute."); plugins.beautylog.error("It seems that the given path " + options.to + " is not absolute.");
return; return;
} }
plugins.beautylog.log("Now cloning " + options.from); plugins.beautylog.log("Now cloning " + options.from);
var cloneOptions = {}; var cloneOptions = {
var cloneRepository = plugins.nodegit.Clone(options.from, options.to, cloneOptions); fetchOpts: {
SmartgitCheck(cloneRepository); callbacks: {
done.resolve(); certificateCheck: function () { return 1; },
credentials: function (url, userName) {
return plugins.nodegit.Cred.sshKeyFromAgent(userName);
}
}
}
};
var cloneRepository = plugins.nodegit.Clone.clone(options.from, options.to, cloneOptions)
.then(function () {
SmartgitCheck(cloneRepository);
done.resolve();
});
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNsb25lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUMvQyxJQUFPLGFBQWEsV0FBVyxrQkFBa0IsQ0FBQyxDQUFDO0FBRW5ELGlCQUFTLFVBQVMsT0FBTztJQUNyQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLHlCQUF5Q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4gICAgICAgIH0pO1xuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59OyJdfQ==

3
dist/smartgit.commit.d.ts vendored Normal file
View File

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

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> require("typings-global");
var plugins = require("./smartgit.plugins"); var plugins = require("./smartgit.plugins");
module.exports = function (pathArg, commitMessage) { module.exports = function (pathArg, commitMessage) {
var result = plugins.nodegit.index.addByPath(pathArg); var result = plugins.nodegit.index.addByPath(pathArg);
@ -7,4 +7,4 @@ module.exports = function (pathArg, commitMessage) {
} }
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNvbW1pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFL0MsaUJBQVMsVUFBUyxPQUFjLEVBQUMsYUFBb0I7SUFDakQsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3RELEVBQUUsQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRWxCLENBQUM7QUFDTCxDQUFDLENBQUMiLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuXG5leHBvcnQgPSBmdW5jdGlvbihwYXRoQXJnOnN0cmluZyxjb21taXRNZXNzYWdlOnN0cmluZykge1xuICAgIHZhciByZXN1bHQgPSBwbHVnaW5zLm5vZGVnaXQuaW5kZXguYWRkQnlQYXRoKHBhdGhBcmcpO1xuICAgIGlmIChyZXN1bHQgPT0gMCkge1xuICAgICAgICBcbiAgICB9XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmNvbW1pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBQ3ZCLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFL0MsaUJBQVMsVUFBUyxPQUFjLEVBQUMsYUFBb0I7SUFDakQsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3RELEVBQUUsQ0FBQyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRWxCLENBQUM7QUFDTCxDQUFDLENBQUMiLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9zbWFydGdpdC5wbHVnaW5zXCIpO1xuXG5leHBvcnQgPSBmdW5jdGlvbihwYXRoQXJnOnN0cmluZyxjb21taXRNZXNzYWdlOnN0cmluZykge1xuICAgIHZhciByZXN1bHQgPSBwbHVnaW5zLm5vZGVnaXQuaW5kZXguYWRkQnlQYXRoKHBhdGhBcmcpO1xuICAgIGlmIChyZXN1bHQgPT0gMCkge1xuICAgICAgICBcbiAgICB9XG59OyJdfQ==

3
dist/smartgit.init.d.ts vendored Normal file
View File

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

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> require("typings-global");
var plugins = require("./smartgit.plugins"); var plugins = require("./smartgit.plugins");
module.exports = function () { module.exports = function () {
var gitinit = function (dest) { var gitinit = function (dest) {
@ -14,4 +14,4 @@ module.exports = function () {
}; };
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxvQkFBb0IsQ0FBQyxDQUFDO0FBRS9DLGlCQUFTO0lBQ0wsSUFBSSxPQUFPLEdBQUcsVUFBUyxJQUF5QjtRQUF6QixvQkFBeUIsR0FBekIsa0JBQXlCO1FBQzVDLEVBQUUsQ0FBQyxDQUFDLElBQUksSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1lBQ3RCLE1BQU0sQ0FBQyxDQUFDLHFDQUFxQztRQUNqRCxDQUFDO1FBQ0QsSUFBSSxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUMseUJBQXlCO1FBQ3pDLE9BQU8sQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLFVBQVUsSUFBSTtZQUM3RCwrQkFBK0I7UUFDbkMsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDLENBQUM7QUFDTixDQUFDLENBQUEiLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vc21hcnRnaXQucGx1Z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csQ0FBQyxDQUFDLENBQUMseUJBQXlCO1FBQ3pDLE9BQU8sQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLFVBQVUsSUFBSTtZQUM3RCwrQkFBK0I7UUFDbkMsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDLENBQUM7QUFDTixDQUFDLENBQUEiLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vc21hcnRnaXQucGx1Z2luc1wiKTtcblxuZXhwb3J0ID0gZnVuY3Rpb24oKXtcbiAgICB2YXIgZ2l0aW5pdCA9IGZ1bmN0aW9uKGRlc3Q6c3RyaW5nID0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICBpZiAoZGVzdCA9PSBcInVuZGVmaW5lZFwiKSB7IC8vbGV0cyBjaGVjayBpZiBhIGRlc3RpbmF0aW9uIGlzIGRlZmluZWQuLi5cbiAgICAgICAgICAgIHJldHVybjsgLy8gLi4uYW5kIHJldHVybiBmdW5jdGlvbiBoZXJlIGlmIG5vdFxuICAgICAgICB9XG4gICAgICAgIHZhciBpc0JhcmUgPSAwOyAvL2xldHMgY3JlYXRlIGEgc3ViZm9sZGVyXG4gICAgICAgIHBsdWdpbnMubm9kZWdpdC5SZXBvc2l0b3J5LmluaXQoZGVzdCwgaXNCYXJlKS50aGVuKGZ1bmN0aW9uIChyZXBvKSB7XG4gICAgICAgICAgICAvLyBkbyBzb21ldGhpbmcgd2l0aCByZXBvIGhlcmUuXG4gICAgICAgIH0pO1xuICAgIH07XG59Il19

1
dist/smartgit.interfaces.d.ts vendored Normal file
View File

@ -0,0 +1 @@
import "typings-global";

View File

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

5
dist/smartgit.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import "typings-global";
export declare let path: any;
export declare let beautylog: any;
export declare let nodegit: any;
export declare let Q: any;

View File

@ -1,8 +1,8 @@
/// <reference path="./typings/main.d.ts" />
"use strict"; "use strict";
require("typings-global");
exports.path = require("path"); exports.path = require("path");
exports.beautylog = require("beautylog"); exports.beautylog = require("beautylog");
exports.nodegit = require("nodegit"); exports.nodegit = require("nodegit");
exports.Q = require("q"); exports.Q = require("q");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDOztBQUVqQyxZQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ3ZCLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGVBQU8sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDN0IsU0FBQyxHQUFHLE9BQU8sQ0FBQy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XRcIik7XG5leHBvcnQgbGV0IFEgPSByZXF1aXJlKFwicVwiKTtcblxuXG4iXX0=

0
dist/smartgit.pull.d.ts vendored Normal file
View File

3
dist/smartgit.pull.js vendored Normal file
View File

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

View File

@ -22,12 +22,14 @@
}, },
"homepage": "https://github.com/pushrocks/smartgit", "homepage": "https://github.com/pushrocks/smartgit",
"dependencies": { "dependencies": {
"beautylog": "^3.1.2", "beautylog": "^5.0.10",
"nodegit": "^0.12.1", "nodegit": "^0.13.2",
"q": "^1.4.1" "q": "^1.4.1",
"typings-global": "^1.0.3"
}, },
"devDependencies": { "devDependencies": {
"npmts": "^4.0.1", "npmts-g": "^5.2.6",
"should": "^8.3.0" "should": "^9.0.2",
"typings-test": "^1.0.1"
} }
} }

1
test/temp2 Submodule

@ -0,0 +1 @@
Subproject commit 2313d2e4d5791cdc4d175425e3eb88c876ceb8bf

2
test/test.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import "typings-test";
import "should";

View File

@ -1,15 +1,24 @@
/// <reference path="../ts/typings/main.d.ts" /> "use strict";
var smartgit = require("../dist/index.js"); require("typings-test");
var beautylog = require("beautylog");
var path = require("path"); var path = require("path");
var should = require("should"); require("should");
var smartgit = require("../dist/index");
describe("smartgit", function () { describe("smartgit", function () {
describe(".clone", function () { describe(".clone", function () {
it("should clone a repository", function (done) { it("should clone a repository using ssh and sshkey", function (done) {
this.timeout(10000);
smartgit.clone({
from: "git@github.com:pushrocks/docs.git",
to: path.resolve("./test/temp/")
}).then(function () {
done();
});
});
it("should clone a repository using https", function (done) {
this.timeout(10000); this.timeout(10000);
smartgit.clone({ smartgit.clone({
from: "https://github.com/pushrocks/docs.git", from: "https://github.com/pushrocks/docs.git",
to: path.resolve("./test/temp/") to: path.resolve("./test/temp2/")
}).then(function () { }).then(function () {
done(); done();
}); });
@ -23,4 +32,4 @@ describe("smartgit", function () {
}); });
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzNDLElBQUksU0FBUyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUNyQyxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDM0IsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRS9CLFFBQVEsQ0FBQyxVQUFVLEVBQUM7SUFDaEIsUUFBUSxDQUFDLFFBQVEsRUFBQztRQUNkLEVBQUUsQ0FBQywyQkFBMkIsRUFBQyxVQUFTLElBQUk7WUFDeEMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNwQixRQUFRLENBQUMsS0FBSyxDQUFDO2dCQUNYLElBQUksRUFBQyx1Q0FBdUM7Z0JBQzVDLEVBQUUsRUFBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQzthQUNsQyxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUNKLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDO0lBQ0gsUUFBUSxDQUFDLFFBQVEsRUFBQztJQUVsQixDQUFDLENBQUMsQ0FBQztJQUNILFFBQVEsQ0FBQyxRQUFRLEVBQUM7SUFFbEIsQ0FBQyxDQUFDLENBQUM7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AgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIGl0KFwic2hvdWxkIGNsb25lIGEgcmVwb3NpdG9yeSB1c2luZyBodHRwc1wiLGZ1bmN0aW9uKGRvbmUpe1xuICAgICAgICAgICAgdGhpcy50aW1lb3V0KDEwMDAwKTtcbiAgICAgICAgICAgIHNtYXJ0Z2l0LmNsb25lKHtcbiAgICAgICAgICAgICAgICBmcm9tOlwiaHR0cHM6Ly9naXRodWIuY29tL3B1c2hyb2Nrcy9kb2NzLmdpdFwiLFxuICAgICAgICAgICAgICAgIHRvOnBhdGgucmVzb2x2ZShcIi4vdGVzdC90ZW1wMi9cIilcbiAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfSk7XG4gICAgZGVzY3JpYmUoXCIuY2hlY2tcIixmdW5jdGlvbigpe1xuXG4gICAgfSk7XG4gICAgZGVzY3JpYmUoXCJjb21taXRcIixmdW5jdGlvbigpe1xuXG4gICAgfSk7XG4gICAgZGVzY3JpYmUoXCJpbml0XCIsZnVuY3Rpb24oKXtcblxuICAgIH0pO1xufSk7Il19

View File

@ -1,16 +1,26 @@
/// <reference path="../ts/typings/main.d.ts" /> import "typings-test";
let smartgit = require("../dist/index.js"); import beautylog = require("beautylog");
let beautylog = require("beautylog"); import path = require("path");
let path = require("path"); import "should"
let should = require("should");
import smartgit = require("../dist/index");
describe("smartgit",function(){ describe("smartgit",function(){
describe(".clone",function(){ describe(".clone",function(){
it("should clone a repository",function(done){ it("should clone a repository using ssh and sshkey",function(done){
this.timeout(10000);
smartgit.clone({
from:"git@github.com:pushrocks/docs.git",
to:path.resolve("./test/temp/")
}).then(function(){
done();
});
});
it("should clone a repository using https",function(done){
this.timeout(10000); this.timeout(10000);
smartgit.clone({ smartgit.clone({
from:"https://github.com/pushrocks/docs.git", from:"https://github.com/pushrocks/docs.git",
to:path.resolve("./test/temp/") to:path.resolve("./test/temp2/")
}).then(function(){ }).then(function(){
done(); done();
}); });

View File

@ -1,16 +1,9 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
import plugins = require("./smartgit.plugins"); import plugins = require("./smartgit.plugins");
import SmartgitCheck = require("./smartgit.check"); import SmartgitCheck = require("./smartgit.check");
import SmartgitClone = require("./smartgit.clone"); export {clone} from "./smartgit.clone";
import SmartgitCommit = require("./smartgit.commit"); import SmartgitCommit = require("./smartgit.commit");
import SmartgitInit = require("./smartgit.init"); import SmartgitInit = require("./smartgit.init");
var smartgit:any = {};
smartgit.clone = SmartgitClone;
smartgit.commit = SmartgitCommit;
smartgit.check = SmartgitCheck;
smartgit.init = SmartgitInit;
module.exports = smartgit;

View File

@ -0,0 +1,7 @@
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

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
import plugins = require("./smartgit.plugins"); import plugins = require("./smartgit.plugins");
export = function(repoArg) { export = function(repoArg) {
return true; return true;

View File

@ -1,14 +1,11 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
import plugins = require("./smartgit.plugins"); import plugins = require("./smartgit.plugins");
import SmartgitCheck = require("./smartgit.check"); import SmartgitCheck = require("./smartgit.check");
export = function(options){ export let clone = (options:{from:string,to:string}) => {
let done = plugins.Q.defer(); let done = plugins.Q.defer();
/***** URL Checks ******/ /***** URL Checks ******/
if (options.from == "undefined" || options.to == "undefined") { //TODO make smartstring URL test
plugins.beautylog.error("smartgit.clone".blue + " : Something is strange about the way you invoked the function");
return;
}
/***** Path Checks ******/ /***** Path Checks ******/
if (!/^\/.*/.test(options.to)){ //check wether path is absolute if (!/^\/.*/.test(options.to)){ //check wether path is absolute
@ -16,11 +13,21 @@ export = function(options){
return; return;
} }
plugins.beautylog.log("Now cloning " + options.from); plugins.beautylog.log("Now cloning " + options.from);
var cloneOptions:any = {}; var cloneOptions:any = {
var cloneRepository = plugins.nodegit.Clone(options.from, options.to, cloneOptions); fetchOpts: {
SmartgitCheck(cloneRepository); callbacks: {
done.resolve(); certificateCheck: function() { return 1; },
credentials: function(url, userName) {
return plugins.nodegit.Cred.sshKeyFromAgent(userName);
}
}
}
};
var cloneRepository = plugins.nodegit.Clone.clone(options.from, options.to, cloneOptions)
.then(() => {
SmartgitCheck(cloneRepository);
done.resolve();
});
return done.promise; return done.promise;
}; };

View File

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
import plugins = require("./smartgit.plugins"); import plugins = require("./smartgit.plugins");
export = function(pathArg:string,commitMessage:string) { export = function(pathArg:string,commitMessage:string) {

View File

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
import plugins = require("./smartgit.plugins"); import plugins = require("./smartgit.plugins");
export = function(){ export = function(){

View File

@ -0,0 +1 @@
import "typings-global"

View File

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" /> import "typings-global"
export let path = require("path"); export let path = require("path");
export let beautylog = require("beautylog"); export let beautylog = require("beautylog");

0
ts/smartgit.pull.ts Normal file
View File

View File

@ -1,7 +0,0 @@
{
"ambientDependencies": {
"colors": "registry:dt/colors#0.6.0-1+20160317120654",
"mocha": "registry:dt/mocha#2.2.5+20160317120654",
"node": "registry:dt/node#4.0.0+20160330064709"
}
}