update some implementations

This commit is contained in:
Philipp Kunz 2016-07-03 04:03:15 +02:00
parent ecede34127
commit 011ac2d7b4
26 changed files with 148 additions and 40 deletions

5
dist/index.d.ts vendored
View File

@ -1,2 +1,5 @@
import "typings-global";
export { clone } from "./smartgit.clone";
export { commit } from "./smartgit.commit";
export { init } from "./smartgit.init";
export { pull } from "./smartgit.pull";
export { push } from "./smartgit.push";

11
dist/index.js vendored
View File

@ -1,5 +1,12 @@
"use strict";
require("typings-global");
var smartgit_clone_1 = require("./smartgit.clone");
exports.clone = smartgit_clone_1.clone;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFFUCxDQUFDLENBRnNCO0FBSXZCLCtCQUFvQixrQkFBa0IsQ0FBQztBQUEvQix1Q0FBK0IifQ==
var smartgit_commit_1 = require("./smartgit.commit");
exports.commit = smartgit_commit_1.commit;
var smartgit_init_1 = require("./smartgit.init");
exports.init = smartgit_init_1.init;
var smartgit_pull_1 = require("./smartgit.pull");
exports.pull = smartgit_pull_1.pull;
var smartgit_push_1 = require("./smartgit.push");
exports.push = smartgit_push_1.push;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsK0JBQW9CLGtCQUFrQixDQUFDO0FBQS9CLHVDQUErQjtBQUN2QyxnQ0FBcUIsbUJBQW1CLENBQUM7QUFBakMsMENBQWlDO0FBQ3pDLDhCQUFtQixpQkFBaUIsQ0FBQztBQUE3QixvQ0FBNkI7QUFDckMsOEJBQW1CLGlCQUFpQixDQUFDO0FBQTdCLG9DQUE2QjtBQUNyQyw4QkFBbUIsaUJBQWlCLENBQUM7QUFBN0Isb0NBQTZCIn0=

3
dist/postinstall.js vendored
View File

@ -1,2 +1,3 @@
"use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdGluc3RhbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wb3N0aW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
var shelljs = require("shelljs");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdGluc3RhbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wb3N0aW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDIn0=

View File

@ -1,4 +1,3 @@
import "typings-global";
export declare let pull: (optionsArg: {
path: string;
ref?: string;

View File

@ -1,5 +1,4 @@
"use strict";
require("typings-global");
exports.pull = function (optionsArg) {
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHYixZQUFJLEdBQUcsVUFBQyxVQUFvQztBQUV2RCxDQUFDLENBQUEifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFVyxZQUFJLEdBQUcsVUFBQyxVQUFvQztBQUV2RCxDQUFDLENBQUEifQ==

View File

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

View File

@ -1,6 +1,5 @@
"use strict";
require("typings-global");
module.exports = function (repoArg) {
return true;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY2hlY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGdpdC5jaGVjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBRXZCLGlCQUFTLFVBQVMsT0FBTztJQUNyQixNQUFNLENBQUMsSUFBSSxDQUFDO0FBQ2hCLENBQUMsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY2hlY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGdpdC5jaGVjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsaUJBQVMsVUFBUyxPQUFPO0lBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUM7QUFDaEIsQ0FBQyxDQUFDIn0=

View File

@ -1,2 +1 @@
declare var _default: (pathArg: string, commitMessage: string) => any;
export = _default;
export declare let commit: (dirPathArg: string, commitMessage: string) => any;

View File

@ -1,8 +1,16 @@
"use strict";
var plugins = require("./smartgit.plugins");
module.exports = function (pathArg, commitMessage) {
exports.commit = function (dirPathArg, commitMessage) {
var done = plugins.Q.defer();
if (!plugins.smartfile.fs.isDirectory(plugins.path.join(dirPathArg, ".git"))) {
plugins.beautylog.error("smartgit.commit expects a valid git directory");
done.reject();
return done.promise;
}
;
// if everything is all right proceed
plugins.shelljs.exec("git commit -m \"" + commitMessage + "\"");
done.resolve();
return done.promise;
};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0NBQStDLENBQUMsQ0FBQztRQUN6RSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDZCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLHFDQUFxQztJQUNyQyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxxQkFBa0IsYUFBYSxPQUFHLENBQUMsQ0FBQztJQUN6RCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==

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

@ -0,0 +1 @@
export declare let isGitDirectory: (dirPathArg: any) => boolean;

6
dist/smartgit.helpers.js vendored Normal file
View File

@ -0,0 +1,6 @@
"use strict";
var plugins = require("./smartgit.plugins");
exports.isGitDirectory = function (dirPathArg) {
return plugins.smartfile.fs.isDirectory(plugins.path.join(dirPathArg, ".git"));
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsc0JBQWMsR0FBRyxVQUFDLFVBQVU7SUFDbkMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLFdBQVcsQ0FDbkMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFDLE1BQU0sQ0FBQyxDQUN2QyxDQUFDO0FBQ04sQ0FBQyxDQUFBIn0=

View File

@ -1,2 +1 @@
declare var _default: () => void;
export = _default;
export declare let init: (dirPathArg: string) => any;

21
dist/smartgit.init.js vendored
View File

@ -1,10 +1,15 @@
"use strict";
module.exports = function () {
var gitinit = function (dest) {
if (dest === void 0) { dest = "undefined"; }
if (dest == "undefined") {
return; // ...and return function here if not
}
};
var plugins = require("./smartgit.plugins");
exports.init = function (dirPathArg) {
var done = plugins.Q.defer();
if (typeof dirPathArg == "undefined") {
plugins.beautylog.error("smartgit.init requires an absolute directory path!");
return;
}
;
plugins.smartfile.fs.ensureDir(dirPathArg);
plugins.shelljs.exec("(cd " + dirPathArg + " && git init)");
done.resolve(dirPathArg);
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVBLGlCQUFTO0lBQ0wsSUFBSSxPQUFPLEdBQUcsVUFBUyxJQUF5QjtRQUF6QixvQkFBeUIsR0FBekIsa0JBQXlCO1FBQzVDLEVBQUUsQ0FBQyxDQUFDLElBQUksSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1lBQ3RCLE1BQU0sQ0FBQyxDQUFDLHFDQUFxQztRQUNqRCxDQUFDO0lBR0wsQ0FBQyxDQUFDO0FBQ04sQ0FBQyxDQUFBIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFcEMsWUFBSSxHQUFHLFVBQUMsVUFBaUI7SUFDaEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUMsQ0FBQyxPQUFPLFVBQVUsSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ25DLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLG9EQUFvRCxDQUFDLENBQUM7UUFDOUUsTUFBTSxDQUFDO0lBQ1gsQ0FBQztJQUFBLENBQUM7SUFDRixPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7SUFDM0MsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBTyxVQUFVLGtCQUFlLENBQUMsQ0FBQztJQUN2RCxJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9

View File

@ -0,0 +1 @@
export declare let pull: (dirPathArg: string, sourceArg?: string, branchArg?: string) => any;

19
dist/smartgit.pull.js vendored
View File

@ -1 +1,18 @@
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1bGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
"use strict";
var plugins = require("./smartgit.plugins");
var helpers = require("./smartgit.helpers");
exports.pull = function (dirPathArg, sourceArg, branchArg) {
if (sourceArg === void 0) { sourceArg = ""; }
if (branchArg === void 0) { branchArg = ""; }
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.pull expects a valid git directory");
done.reject();
return done.promse;
}
;
plugins.shelljs.exec("(cd " + dirPathArg + " && git pull " + sourceArg + " " + branchArg + ")");
done.resolve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al file
View File

@ -0,0 +1 @@
export declare let push: (dirPathArg: string, sourceArg?: string, branchArg?: string) => any;

18
dist/smartgit.push.js vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
var plugins = require("./smartgit.plugins");
var helpers = require("./smartgit.helpers");
exports.push = function (dirPathArg, sourceArg, branchArg) {
if (sourceArg === void 0) { sourceArg = ""; }
if (branchArg === void 0) { branchArg = ""; }
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.push expects a valid git directory");
done.reject();
return done.promise;
}
// if everything seems allright proceed
plugins.shelljs.exec("");
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzlFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3hCLENBQUM7SUFDRCx1Q0FBdUM7SUFDdkMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekIsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=

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

1
dist/smartgit.remote.js vendored Normal file
View File

@ -0,0 +1 @@
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucmVtb3RlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQucmVtb3RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==

View File

@ -1,7 +1,7 @@
import plugins = require("./smartgit.plugins");
import SmartgitCheck = require("./smartgit.check");
export {clone} from "./smartgit.clone";
import SmartgitCommit = require("./smartgit.commit");
import SmartgitInit = require("./smartgit.init");
export {commit} from "./smartgit.commit";
export {init} from "./smartgit.init";
export {pull} from "./smartgit.pull";
export {push} from "./smartgit.push";

View File

@ -1,7 +1,15 @@
import plugins = require("./smartgit.plugins");
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export = function(pathArg:string,commitMessage:string) {
export let commit = (dirPathArg:string,commitMessage:string) => {
let done = plugins.Q.defer();
if(!plugins.smartfile.fs.isDirectory(plugins.path.join(dirPathArg,".git"))){
plugins.beautylog.error("smartgit.commit expects a valid git directory");
done.reject();
return done.promise;
};
// if everything is all right proceed
plugins.shelljs.exec(`git commit -m "${commitMessage}"`);
done.resolve();
return done.promise;
};

7
ts/smartgit.helpers.ts Normal file
View File

@ -0,0 +1,7 @@
import * as plugins from "./smartgit.plugins";
export let isGitDirectory = (dirPathArg):boolean => {
return plugins.smartfile.fs.isDirectory(
plugins.path.join(dirPathArg,".git")
);
}

View File

@ -1,11 +1,13 @@
import plugins = require("./smartgit.plugins");
export = function(){
var gitinit = function(dest:string = "undefined") {
if (dest == "undefined") { //lets check if a destination is defined...
return; // ...and return function here if not
}
export let init = (dirPathArg:string) => {
let done = plugins.Q.defer();
if (typeof dirPathArg == "undefined") { //lets check if a destination is defined...
plugins.beautylog.error("smartgit.init requires an absolute directory path!");
return;
};
}
plugins.smartfile.fs.ensureDir(dirPathArg);
plugins.shelljs.exec(`(cd ${dirPathArg} && git init)`);
done.resolve(dirPathArg);
return done.promise;
};

View File

@ -0,0 +1,13 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let pull = (dirPathArg:string,sourceArg:string = "", branchArg:string = "") => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.pull expects a valid git directory");
done.reject();
return done.promse;
};
plugins.shelljs.exec(`(cd ${dirPathArg} && git pull ${sourceArg} ${branchArg})`);
done.resolve(dirPathArg);
return done.promise;
};

15
ts/smartgit.push.ts Normal file
View File

@ -0,0 +1,15 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string = "") => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.push expects a valid git directory");
done.reject();
return done.promise;
}
// if everything seems allright proceed
plugins.shelljs.exec("");
done.resolve();
return done.promise;
};

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