now can work with remotes
This commit is contained in:
parent
9ae3acb3d8
commit
7e2481d511
@ -20,4 +20,4 @@ Features:
|
|||||||
* push changes
|
* push changes
|
||||||
* add/remove remotes
|
* add/remove remotes
|
||||||
|
|
||||||
Tip: use smartssh to setup your SSH environment
|
Tip: use [smartssh](https://npmjs.com/smartssh) to setup your SSH environment
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -5,3 +5,4 @@ export { init } from "./smartgit.init";
|
|||||||
export { pull } from "./smartgit.pull";
|
export { pull } from "./smartgit.pull";
|
||||||
export { push } from "./smartgit.push";
|
export { push } from "./smartgit.push";
|
||||||
export { remote } from "./smartgit.remote";
|
export { remote } from "./smartgit.remote";
|
||||||
|
export { status } from "./smartgit.status";
|
||||||
|
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -13,4 +13,6 @@ var smartgit_push_1 = require("./smartgit.push");
|
|||||||
exports.push = smartgit_push_1.push;
|
exports.push = smartgit_push_1.push;
|
||||||
var smartgit_remote_1 = require("./smartgit.remote");
|
var smartgit_remote_1 = require("./smartgit.remote");
|
||||||
exports.remote = smartgit_remote_1.remote;
|
exports.remote = smartgit_remote_1.remote;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsNkJBQWtCLGdCQUFnQixDQUFDO0FBQTNCLGlDQUEyQjtBQUNuQywrQkFBb0Isa0JBQWtCLENBQUM7QUFBL0IsdUNBQStCO0FBQ3ZDLGdDQUFxQixtQkFBbUIsQ0FBQztBQUFqQywwQ0FBaUM7QUFDekMsOEJBQW1CLGlCQUFpQixDQUFDO0FBQTdCLG9DQUE2QjtBQUNyQyw4QkFBbUIsaUJBQWlCLENBQUM7QUFBN0Isb0NBQTZCO0FBQ3JDLDhCQUFtQixpQkFBaUIsQ0FBQztBQUE3QixvQ0FBNkI7QUFDckMsZ0NBQXFCLG1CQUFtQixDQUFDO0FBQWpDLDBDQUFpQyJ9
|
var smartgit_status_1 = require("./smartgit.status");
|
||||||
|
exports.status = smartgit_status_1.status;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsNkJBQWtCLGdCQUFnQixDQUFDO0FBQTNCLGlDQUEyQjtBQUNuQywrQkFBb0Isa0JBQWtCLENBQUM7QUFBL0IsdUNBQStCO0FBQ3ZDLGdDQUFxQixtQkFBbUIsQ0FBQztBQUFqQywwQ0FBaUM7QUFDekMsOEJBQW1CLGlCQUFpQixDQUFDO0FBQTdCLG9DQUE2QjtBQUNyQyw4QkFBbUIsaUJBQWlCLENBQUM7QUFBN0Isb0NBQTZCO0FBQ3JDLDhCQUFtQixpQkFBaUIsQ0FBQztBQUE3QixvQ0FBNkI7QUFDckMsZ0NBQXFCLG1CQUFtQixDQUFDO0FBQWpDLDBDQUFpQztBQUN6QyxnQ0FBcUIsbUJBQW1CLENBQUM7QUFBakMsMENBQWlDIn0=
|
4
dist/smartgit.pull.js
vendored
4
dist/smartgit.pull.js
vendored
@ -8,7 +8,7 @@ exports.pull = function (dirPathArg, sourceArg, branchArg) {
|
|||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
||||||
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
||||||
done.reject();
|
done.reject();
|
||||||
return done.promse;
|
return done.promise;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
// if everything is allright proceed
|
// if everything is allright proceed
|
||||||
@ -16,4 +16,4 @@ exports.pull = function (dirPathArg, sourceArg, branchArg) {
|
|||||||
done.resolve(dirPathArg);
|
done.resolve(dirPathArg);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1bGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFDLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzdFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDO0lBQ3ZCLENBQUM7SUFBQSxDQUFDO0lBQ0Ysb0NBQW9DO0lBQ3BDLE9BQU8sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFNBQU8sVUFBVSxxQkFBZ0IsU0FBUyxTQUFJLFNBQVMsTUFBRyxDQUFDLENBQUM7SUFDakYsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN6QixNQUFN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9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==
|
4
dist/smartgit.push.js
vendored
4
dist/smartgit.push.js
vendored
@ -11,8 +11,8 @@ exports.push = function (dirPathArg, sourceArg, branchArg) {
|
|||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
// if everything seems allright proceed
|
// if everything seems allright proceed
|
||||||
plugins.shelljs.exec("");
|
plugins.shelljs.exec("(cd " + dirPathArg + " && git status)");
|
||||||
done.resolve();
|
done.resolve();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzlFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3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UFpQixDQUFDLENBQUM7SUFDekQsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=
|
5
dist/smartgit.remote.d.ts
vendored
5
dist/smartgit.remote.d.ts
vendored
@ -1,4 +1,5 @@
|
|||||||
export declare let remote: {
|
export declare let remote: {
|
||||||
add: (dirPathArg: any) => void;
|
add: (dirPathArg: any, remoteNameArg: string, remoteLinkArg: string) => any;
|
||||||
remove: () => void;
|
list: (dirPathArg: any) => any;
|
||||||
|
remove: (dirPathArg: string) => any;
|
||||||
};
|
};
|
||||||
|
59
dist/smartgit.remote.js
vendored
59
dist/smartgit.remote.js
vendored
@ -1,12 +1,61 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var plugins = require("./smartgit.plugins");
|
var plugins = require("./smartgit.plugins");
|
||||||
var addRemote = function (dirPathArg) {
|
var helpers = require("./smartgit.helpers");
|
||||||
|
var add = function (dirPathArg, remoteNameArg, remoteLinkArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid git directory");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (!remoteNameArg) {
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid remote name");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (!remoteLinkArg) {
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid remote link");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
// if everything is all right proceed
|
||||||
|
plugins.shelljs.exec("cd " + dirPathArg + " && git remote add " + remoteNameArg + " " + remoteLinkArg);
|
||||||
|
exports.remote.list(dirPathArg);
|
||||||
|
done.resolve();
|
||||||
|
return done.promise;
|
||||||
};
|
};
|
||||||
var removeRemote = function () {
|
var check = function (dirPathArg, remoteNameArg, remoteLinkArg) {
|
||||||
|
};
|
||||||
|
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();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
// if everything is all right proceed
|
||||||
|
plugins.shelljs.exec("cd " + dirPathArg + " && git remote -v").stdout;
|
||||||
|
done.resolve(remotes);
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
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();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
// if everything is all right
|
||||||
};
|
};
|
||||||
exports.remote = {
|
exports.remote = {
|
||||||
add: addRemote,
|
add: add,
|
||||||
remove: removeRemote
|
list: list,
|
||||||
|
remove: remove
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucmVtb3RlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQucmVtb3RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBRzlDLElBQUksU0FBUyxHQUFHLFVBQUMsVUFBVTtJQUN2QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0FBR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QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUFBLENBQUM7SUFDRixzQ0FBc0M7SUFDdEMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBTSxVQUFVLHNCQUFtQixDQUFDLENBQUMsTUFBTSxDQUFDO0lBQ2pFLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDdEIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDO0FBRUYsSUFBSSxNQUFNLEdBQUcsVUFBQyxVQUFpQjtJQUMzQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDcEMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsc0RBQXNELENBQUMsQ0FBQztRQUNoRixJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDZCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLDhCQUE4QjtBQUNsQyxDQUFDLENBQUE7QUFFVSxjQUFNLEdBQUc7SUFDaEIsR0FBRyxFQUFFLEdBQUc7SUFDUixJQUFJLEVBQUUsSUFBSTtJQUNWLE1BQU0sRUFBRSxNQUFNO0NBQ2pCLENBQUEifQ==
|
1
dist/smartgit.status.d.ts
vendored
Normal file
1
dist/smartgit.status.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare let status: (dirPathArg: string) => any;
|
16
dist/smartgit.status.js
vendored
Normal file
16
dist/smartgit.status.js
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
"use strict";
|
||||||
|
var plugins = require("./smartgit.plugins");
|
||||||
|
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();
|
||||||
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuc3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuc3RhdHVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQzlDLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsY0FBTSxHQUFHLFVBQUMsVUFBaUI7SUFDbEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLCtDQUErQyxDQUFDLENBQUM7UUFDekUsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQ2QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUNELHVDQUF1QztJQUN2QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUsb0JBQWlCLENBQUMsQ0FBQztJQUN6RCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==
|
22
test/test.js
22
test/test.js
@ -14,7 +14,7 @@ var paths = {
|
|||||||
describe("smartgit", function () {
|
describe("smartgit", function () {
|
||||||
describe(".clone", function () {
|
describe(".clone", function () {
|
||||||
it("should clone a repository using ssh and sshkey", function (done) {
|
it("should clone a repository using ssh and sshkey", function (done) {
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
smartgit.clone({
|
smartgit.clone({
|
||||||
from: "git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
from: "git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
||||||
to: paths.temp
|
to: paths.temp
|
||||||
@ -23,7 +23,7 @@ describe("smartgit", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
it("should clone a repository using https", function (done) {
|
it("should clone a repository using https", function (done) {
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
smartgit.clone({
|
smartgit.clone({
|
||||||
from: "https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
from: "https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
||||||
to: paths.temp2
|
to: paths.temp2
|
||||||
@ -58,7 +58,7 @@ describe("smartgit", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("pull", function () {
|
describe("pull", function () {
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
it("should error for noGit", function () {
|
it("should error for noGit", function () {
|
||||||
smartgit.pull(paths.noGit);
|
smartgit.pull(paths.noGit);
|
||||||
});
|
});
|
||||||
@ -66,5 +66,19 @@ describe("smartgit", function () {
|
|||||||
smartgit.pull(paths.temp);
|
smartgit.pull(paths.temp);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe("remote", function () {
|
||||||
|
it("should error for noGit", function () {
|
||||||
|
smartgit.remote.add(paths.noGit, null, null);
|
||||||
|
});
|
||||||
|
it("should error for no remote name", function () {
|
||||||
|
smartgit.remote.add(paths.temp, null, null);
|
||||||
|
});
|
||||||
|
it("should error for no remote link", function () {
|
||||||
|
smartgit.remote.add(paths.temp, "origin", null);
|
||||||
|
});
|
||||||
|
it("should add a remote", function () {
|
||||||
|
smartgit.remote.add(paths.temp, "origin2", "https://github.com/pushrocks/somerepo");
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFFdEIsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQ2pDLElBQU8sSUFBSSxXQUFXLE1BQU0sQ0FBQyxDQUFDO0FBQzlCLFFBQU8sUUFFUCxDQUFDLENBRmM7QUFFZixJQUFPLFFBQVEsV0FBVyxlQUFlLENBQUMsQ0FBQztBQUMzQyxJQUFJLEtBQUssR0FBRztJQUNSLElBQUksRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQztJQUNsQyxLQUFLLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxlQUFlLENBQUM7SUFDcEMsS0FBSyxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDO0lBQ25DLEtBQUssRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQztJQUNuQyxLQUFLLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUM7Q0FDakMsQ0FBQTtBQUVELFFBQVEsQ0FBQyxVQUFVLEVBQUM7SUFDaEIsUUFBUSxDQUFDLFFB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QUFFLENBQUMsd0JBQXdCLEVBQUM7WUFDeEIsUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLEtBQUssRUFBQyxJQUFJLEVBQUMsSUFBSSxDQUFDLENBQUM7UUFDL0MsQ0FBQyxDQUFDLENBQUM7UUFDSCxFQUFFLENBQUMsaUNBQWlDLEVBQUM7WUFDakMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLElBQUksRUFBQyxJQUFJLEVBQUMsSUFBSSxDQUFDLENBQUM7UUFDOUMsQ0FBQyxDQUFDLENBQUM7UUFDSCxFQUFFLENBQUMsaUNBQWlDLEVBQUM7WUFDakMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLElBQUksRUFBQyxRQUFRLEVBQUMsSUFBSSxDQUFDLENBQUM7UUFDbEQsQ0FBQyxDQUFDLENBQUM7UUFDSCxFQUFFLENBQUMscUJBQXFCLEVBQUM7WUFDckIsUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLElBQUksRUFBQyxTQUFTLEVBQUMsdUNBQXVDLENBQUMsQ0FBQztRQUN0RixDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMifQ==
|
20
test/test.ts
20
test/test.ts
@ -16,7 +16,7 @@ let paths = {
|
|||||||
describe("smartgit",function(){
|
describe("smartgit",function(){
|
||||||
describe(".clone",function(){
|
describe(".clone",function(){
|
||||||
it("should clone a repository using ssh and sshkey",function(done){
|
it("should clone a repository using ssh and sshkey",function(done){
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
smartgit.clone({
|
smartgit.clone({
|
||||||
from:"git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
from:"git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
||||||
to:paths.temp
|
to:paths.temp
|
||||||
@ -25,7 +25,7 @@ describe("smartgit",function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
it("should clone a repository using https",function(done){
|
it("should clone a repository using https",function(done){
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
smartgit.clone({
|
smartgit.clone({
|
||||||
from:"https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
from:"https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
||||||
to:paths.temp2
|
to:paths.temp2
|
||||||
@ -60,7 +60,7 @@ describe("smartgit",function(){
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
describe("pull",function(){
|
describe("pull",function(){
|
||||||
this.timeout(20000);
|
this.timeout(40000);
|
||||||
it("should error for noGit",function(){
|
it("should error for noGit",function(){
|
||||||
smartgit.pull(paths.noGit);
|
smartgit.pull(paths.noGit);
|
||||||
});
|
});
|
||||||
@ -68,4 +68,18 @@ describe("smartgit",function(){
|
|||||||
smartgit.pull(paths.temp);
|
smartgit.pull(paths.temp);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
describe("remote",function(){
|
||||||
|
it("should error for noGit",function(){
|
||||||
|
smartgit.remote.add(paths.noGit,null,null);
|
||||||
|
});
|
||||||
|
it("should error for no remote name",function(){
|
||||||
|
smartgit.remote.add(paths.temp,null,null);
|
||||||
|
});
|
||||||
|
it("should error for no remote link",function(){
|
||||||
|
smartgit.remote.add(paths.temp,"origin",null);
|
||||||
|
});
|
||||||
|
it("should add a remote",function(){
|
||||||
|
smartgit.remote.add(paths.temp,"origin2","https://github.com/pushrocks/somerepo");
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
@ -7,3 +7,4 @@ export {init} from "./smartgit.init";
|
|||||||
export {pull} from "./smartgit.pull";
|
export {pull} from "./smartgit.pull";
|
||||||
export {push} from "./smartgit.push";
|
export {push} from "./smartgit.push";
|
||||||
export {remote} from "./smartgit.remote";
|
export {remote} from "./smartgit.remote";
|
||||||
|
export {status} from "./smartgit.status";
|
||||||
|
@ -6,7 +6,7 @@ export let pull = (dirPathArg:string,sourceArg:string = "", branchArg:string = "
|
|||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
if(!helpers.isGitDirectory(dirPathArg)){
|
||||||
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
||||||
done.reject();
|
done.reject();
|
||||||
return done.promse;
|
return done.promise;
|
||||||
};
|
};
|
||||||
// if everything is allright proceed
|
// if everything is allright proceed
|
||||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git pull ${sourceArg} ${branchArg})`);
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git pull ${sourceArg} ${branchArg})`);
|
||||||
|
@ -9,7 +9,7 @@ export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string =
|
|||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
// if everything seems allright proceed
|
// if everything seems allright proceed
|
||||||
plugins.shelljs.exec("");
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
|
||||||
done.resolve();
|
done.resolve();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
@ -1,16 +1,60 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
import * as plugins from "./smartgit.plugins";
|
||||||
import * as helpers from "./smartgit.helpers";
|
import * as helpers from "./smartgit.helpers";
|
||||||
|
|
||||||
let addRemote = (dirPathArg) => {
|
let add = (dirPathArg,remoteNameArg:string, remoteLinkArg:string) => {
|
||||||
let done = plugins.Q.defer();
|
let done = plugins.Q.defer();
|
||||||
|
if(!helpers.isGitDirectory(dirPathArg)){
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid git directory");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
if(!remoteNameArg) {
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid remote name");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
if(!remoteLinkArg) {
|
||||||
|
plugins.beautylog.error("smartgit.remote.add expects a valid remote link");
|
||||||
|
done.reject();
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
// if everything is all right proceed
|
||||||
|
plugins.shelljs.exec(`cd ${dirPathArg} && git remote add ${remoteNameArg} ${remoteLinkArg}`);
|
||||||
|
remote.list(dirPathArg);
|
||||||
|
done.resolve();
|
||||||
|
return done.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
let removeRemote = () => {
|
let check = (dirPathArg:string, remoteNameArg:string, remoteLinkArg) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
// if everything is all right proceed
|
||||||
|
plugins.shelljs.exec(`cd ${dirPathArg} && git remote -v`).stdout;
|
||||||
|
done.resolve(remotes);
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
|
||||||
|
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();
|
||||||
|
return done.promise;
|
||||||
|
};
|
||||||
|
// if everything is all right
|
||||||
|
}
|
||||||
|
|
||||||
export let remote = {
|
export let remote = {
|
||||||
add: addRemote,
|
add: add,
|
||||||
remove: removeRemote
|
list: list,
|
||||||
|
remove: remove
|
||||||
}
|
}
|
15
ts/smartgit.status.ts
Normal file
15
ts/smartgit.status.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import * as plugins from "./smartgit.plugins";
|
||||||
|
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();
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
// if everything seems allright proceed
|
||||||
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
|
||||||
|
done.resolve();
|
||||||
|
return done.promise;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user