improve typings and tests

This commit is contained in:
Philipp Kunz 2016-07-05 03:47:38 +02:00
parent c7f87eebae
commit ae5b6b5afd
27 changed files with 125 additions and 67 deletions

View File

@ -1,3 +1,5 @@
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let add: {
addAll: (dirPathArg: string) => any;
addAll: (dirPathArg: string) => plugins.Q.Promise<{}>;
};

View File

@ -4,8 +4,9 @@ var helpers = require("./smartgit.helpers");
var addAll = function (dirPathArg) {
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.add expects a valid git directory!");
done.reject();
var err = new Error("smartgit.add expects a valid git directory!");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -17,4 +18,4 @@ var addAll = function (dirPathArg) {
exports.add = {
addAll: addAll
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQzlDLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFOUMsSUFBSSxNQUFNLEdBQUcsVUFBQyxVQUFpQjtJQUMzQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDcEMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsNkNBQTZDLENBQUMsQ0FBQztRQUN2RSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDZCxNQUFNLENBQUMsSU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MsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLDhCQUE4QjtJQUM5QixPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUsa0NBQStCLENBQUMsQ0FBQztJQUN2RSxJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQztBQUVTLFdBQUcsR0FBRztJQUNiLE1BQU0sRUFBRSxNQUFNO0NBQ2pCLENBQUEifQ==

View File

@ -1,7 +1,9 @@
/// <reference types="q" />
import plugins = require("./smartgit.plugins");
export declare let clone: (optionsArg: {
from: string;
to: string;
key?: string;
keyPath?: string;
keyPassphrase?: string;
}) => any;
}) => plugins.Q.Promise<{}>;

View File

@ -1 +1,3 @@
export declare let commit: (dirPathArg: string, commitMessage: string) => any;
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let commit: (dirPathArg: string, commitMessage: string) => plugins.Q.Promise<{}>;

View File

@ -4,8 +4,9 @@ var helpers = require("./smartgit.helpers");
exports.commit = function (dirPathArg, commitMessage) {
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.commit expects a valid git directory");
done.reject();
var err = new Error("smartgit.commit expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -14,4 +15,4 @@ exports.commit = function (dirPathArg, commitMessage) {
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuY29tbWl0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTS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ElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDcEMsSUFBSSxHQUFHLEdBQUcsSUFBSSxLQUFLLENBQUMsK0NBQStDLENBQUMsQ0FBQztRQUNyRSxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDckMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNqQixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLHFDQUFxQztJQUNyQyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUsNEJBQXNCLGFBQWEsUUFBSSxDQUFDLENBQUM7SUFDL0UsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=

View File

@ -1 +1,3 @@
export declare let init: (dirPathArg: string) => any;
/// <reference types="q" />
import plugins = require("./smartgit.plugins");
export declare let init: (dirPathArg: string) => plugins.Q.Promise<{}>;

View File

@ -3,8 +3,10 @@ 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;
var err = new Error("smartgit.init requires an absolute directory path!");
plugins.beautylog.error(err.message);
done.reject("err");
return done.promise;
}
;
plugins.smartfile.fs.ensureDir(dirPathArg);
@ -12,4 +14,4 @@ exports.init = function (dirPathArg) {
done.resolve(dirPathArg);
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,ey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VBQUMsVUFBaUI7SUFDaEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUMsQ0FBQyxPQUFPLFVBQVUsSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ25DLElBQUksR0FBRyxHQUFHLElBQUksS0FBSyxDQUFDLG9EQUFvRCxDQUFDLENBQUE7UUFDekUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLElBQUksQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDbkIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUFBLENBQUM7SUFDRixPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7SUFDM0MsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBTyxVQUFVLGtCQUFlLENBQUMsQ0FBQztJQUN2RCxJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9

View File

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

View File

@ -7,4 +7,4 @@ exports.shelljs = require("shelljs");
exports.smartfile = require("smartfile");
exports.smartpath = require("smartpath");
exports.smartstring = require("smartstring");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUVWLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ3BDLFNBQUMsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDakIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMxQixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsbUJBQVcsV0FBVyxhQUFhLENBQUMsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNWLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNwQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQzFCLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsaUJBQVMsV0FBVyxXQUFXLENBQUMsQ0FBQztBQUNqQyxtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDIn0=

View File

@ -1 +1,3 @@
export declare let pull: (dirPathArg: string, sourceArg?: string, branchArg?: string) => any;
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let pull: (dirPathArg: string, sourceArg?: string, branchArg?: string) => plugins.Q.Promise<{}>;

View File

@ -6,8 +6,9 @@ exports.pull = function (dirPathArg, sourceArg, branchArg) {
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();
var err = new Error("smartgit.pull expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -16,4 +17,4 @@ exports.pull = function (dirPathArg, sourceArg, branchArg) {
done.resolve(dirPathArg);
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1bGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFDLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzdFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQU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xJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ2pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3hCLENBQUM7SUFBQSxDQUFDO0lBQ0Ysb0NBQW9DO0lBQ3BDLE9BQU8sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFNBQU8sVUFBVSxxQkFBZ0IsU0FBUyxTQUFJLFNBQVMsTUFBRyxDQUFDLENBQUM7SUFDakYsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN6QixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==

View File

@ -1 +1,3 @@
export declare let push: (dirPathArg: string, remoteNameArg?: string, remoteBranchArg?: string) => any;
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let push: (dirPathArg: string, remoteNameArg?: string, remoteBranchArg?: string) => plugins.Q.Promise<{}>;

View File

@ -6,8 +6,9 @@ exports.push = function (dirPathArg, remoteNameArg, remoteBranchArg) {
if (remoteBranchArg === void 0) { remoteBranchArg = ""; }
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.push expects a valid git directory");
done.reject();
var err = new Error("smartgit.push expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
// if everything seems allright proceed
@ -15,4 +16,4 @@ exports.push = function (dirPathArg, remoteNameArg, remoteBranchArg) {
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7Q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QUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLGFBQXlCLEVBQUUsZUFBMkI7SUFBdEQsNkJBQXlCLEdBQXpCLGtCQUF5QjtJQUFFLCtCQUEyQixHQUEzQixvQkFBMkI7SUFDeEYsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLElBQUksR0FBRyxHQUFHLElBQUksS0FBSyxDQUFDLDZDQUE2QyxDQUFDLENBQUM7UUFDbkUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDakIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUNELHVDQUF1QztJQUN2QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUscUJBQWdCLGFBQWEsU0FBSSxlQUFlLE1BQUcsQ0FBQyxDQUFDO0lBQzNGLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9

View File

@ -1,5 +1,7 @@
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let remote: {
add: (dirPathArg: any, remoteNameArg: string, remoteLinkArg: string) => any;
list: (dirPathArg: any) => any;
remove: (dirPathArg: string) => any;
add: (dirPathArg: any, remoteNameArg: string, remoteLinkArg: string) => plugins.Q.Promise<{}>;
list: (dirPathArg: any) => plugins.Q.Promise<{}>;
remove: (dirPathArg: string) => plugins.Q.Promise<{}>;
};

View File

@ -4,20 +4,23 @@ var helpers = require("./smartgit.helpers");
var add = function (dirPathArg, remoteNameArg, remoteLinkArg) {
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.remote.add expects a valid git directory");
done.reject();
var err = new Error("smartgit.remote.add expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
if (!remoteNameArg) {
plugins.beautylog.error("smartgit.remote.add expects a valid remote name");
done.reject();
var err = new Error("smartgit.remote.add expects a valid remote name");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
if (!remoteLinkArg) {
plugins.beautylog.error("smartgit.remote.add expects a valid remote link");
done.reject();
var err = new Error();
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -33,8 +36,9 @@ var list = function (dirPathArg) {
var done = plugins.Q.defer();
var remotes = {};
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.remote.list expects a valid git directory");
done.reject();
var err = new Error("smartgit.remote.list expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -46,8 +50,9 @@ var list = function (dirPathArg) {
var remove = function (dirPathArg) {
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.remote.remove expects a valid git directory");
done.reject();
var err = new Error("smartgit.remote.remove expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
@ -58,4 +63,4 @@ exports.remote = {
list: list,
remove: remove
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucmVtb3RlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQucmVtb3RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUF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R0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDcEMsSUFBSSxHQUFHLEdBQUcsSUFBSSxLQUFLLENBQUMsc0RBQXNELENBQUMsQ0FBQztRQUM1RSxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDckMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNqQixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLDhCQUE4QjtBQUNsQyxDQUFDLENBQUE7QUFFVSxjQUFNLEdBQUc7SUFDaEIsR0FBRyxFQUFFLEdBQUc7SUFDUixJQUFJLEVBQUUsSUFBSTtJQUNWLE1BQU0sRUFBRSxNQUFNO0NBQ2pCLENBQUEifQ==

View File

@ -1 +1,3 @@
export declare let status: (dirPathArg: string) => any;
/// <reference types="q" />
import * as plugins from "./smartgit.plugins";
export declare let status: (dirPathArg: string) => plugins.Q.Promise<{}>;

View File

@ -4,13 +4,15 @@ var helpers = require("./smartgit.helpers");
exports.status = function (dirPathArg) {
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.status expects a valid git directory");
done.reject();
var err = new Error("smartgit.status expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
;
// if everything seems allright proceed
plugins.shelljs.exec("(cd " + dirPathArg + " && git status)");
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuc3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi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QUFHLFVBQUMsVUFBaUI7SUFDbEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLElBQUksR0FBRyxHQUFHLElBQUksS0FBSyxDQUFDLCtDQUErQyxDQUFDLENBQUM7UUFDckUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3JDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDakIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUFBLENBQUM7SUFDRix1Q0FBdUM7SUFDdkMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBTyxVQUFVLG9CQUFpQixDQUFDLENBQUM7SUFDekQsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=

View File

@ -66,6 +66,15 @@ describe("smartgit", function () {
smartgit.pull(paths.temp);
});
});
describe("push", function () {
this.timeout(40000);
it("should error for noGit", function () {
smartgit.push(paths.noGit);
});
it("should push to origin", function () {
smartgit.push(paths.temp, "origin", "master");
});
});
describe("remote", function () {
it("should error for noGit", function () {
smartgit.remote.add(paths.noGit, null, null);
@ -81,4 +90,4 @@ describe("smartgit", function () {
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQU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DO1FBQzlDLENBQUMsQ0FBQyxDQUFDO1FBQ0gsRUFBRSxDQUFDLGlDQUFpQyxFQUFDO1lBQ2pDLFFBQVEsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLEVBQUMsUUFBUSxFQUFDLElBQUksQ0FBQyxDQUFDO1FBQ2xELENBQUMsQ0FBQyxDQUFDO1FBQ0gsRUFBRSxDQUFDLHFCQUFxQixFQUFDO1lBQ3JCLFFBQVEsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLEVBQUMsU0FBUyxFQUFDLHVDQUF1QyxDQUFDLENBQUM7UUFDdEYsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDLENBQUMsQ0FBQztBQUNQLENBQUMsQ0FBQyxDQUFDIn0=

View File

@ -68,6 +68,15 @@ describe("smartgit",function(){
smartgit.pull(paths.temp);
})
});
describe("push",function(){
this.timeout(40000);
it("should error for noGit",function(){
smartgit.push(paths.noGit);
});
it("should push to origin",function(){
smartgit.push(paths.temp,"origin","master");
})
});
describe("remote",function(){
it("should error for noGit",function(){
smartgit.remote.add(paths.noGit,null,null);

View File

@ -4,8 +4,9 @@ import * as helpers from "./smartgit.helpers";
let addAll = (dirPathArg:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.add expects a valid git directory!");
done.reject();
let err = new Error("smartgit.add expects a valid git directory!");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is ok proceed

View File

@ -4,8 +4,9 @@ import * as helpers from "./smartgit.helpers";
export let commit = (dirPathArg:string,commitMessage:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.commit expects a valid git directory");
done.reject();
let err = new Error("smartgit.commit expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is all right proceed

View File

@ -3,8 +3,10 @@ import plugins = require("./smartgit.plugins");
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;
let err = new Error("smartgit.init requires an absolute directory path!")
plugins.beautylog.error(err.message);
done.reject("err");
return done.promise;
};
plugins.smartfile.fs.ensureDir(dirPathArg);
plugins.shelljs.exec(`(cd ${dirPathArg} && git init)`);

View File

@ -1,8 +1,7 @@
import "typings-global";
export import path = require("path");
export import beautylog = require("beautylog");
export let Q = require("q");
export import Q = require("q");
export let shelljs = require("shelljs");
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");

View File

@ -4,8 +4,9 @@ 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();
let err = new Error("smartgit.pull expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is allright proceed

View File

@ -4,8 +4,9 @@ import * as helpers from "./smartgit.helpers";
export let push = (dirPathArg:string, remoteNameArg:string = "", remoteBranchArg:string = "") => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.push expects a valid git directory");
done.reject();
let err = new Error("smartgit.push expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
// if everything seems allright proceed

View File

@ -4,18 +4,21 @@ import * as helpers from "./smartgit.helpers";
let add = (dirPathArg,remoteNameArg:string, remoteLinkArg:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.remote.add expects a valid git directory");
done.reject();
let err = new Error("smartgit.remote.add expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
if(!remoteNameArg) {
plugins.beautylog.error("smartgit.remote.add expects a valid remote name");
done.reject();
let err = new Error("smartgit.remote.add expects a valid remote name");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
if(!remoteLinkArg) {
plugins.beautylog.error("smartgit.remote.add expects a valid remote link");
done.reject();
let err = new Error();
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is all right proceed
@ -33,8 +36,9 @@ let list = (dirPathArg) => {
let done = plugins.Q.defer();
let remotes = {};
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.remote.list expects a valid git directory");
done.reject();
let err = new Error("smartgit.remote.list expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is all right proceed
@ -46,8 +50,9 @@ let list = (dirPathArg) => {
let remove = (dirPathArg:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.remote.remove expects a valid git directory");
done.reject();
let err = new Error("smartgit.remote.remove expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
};
// if everything is all right

View File

@ -4,10 +4,11 @@ import * as helpers from "./smartgit.helpers";
export let status = (dirPathArg:string) => {
let done = plugins.Q.defer();
if(!helpers.isGitDirectory(dirPathArg)){
plugins.beautylog.error("smartgit.status expects a valid git directory");
done.reject();
let err = new Error("smartgit.status expects a valid git directory");
plugins.beautylog.error(err.message);
done.reject(err);
return done.promise;
}
};
// if everything seems allright proceed
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
done.resolve();