This commit is contained in:
Philipp Kunz 2016-07-04 04:59:39 +02:00
parent 7670698e84
commit 63c54ff790
3 changed files with 8 additions and 8 deletions

View File

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

10
dist/smartgit.push.js vendored
View File

@ -1,9 +1,9 @@
"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 = ""; }
exports.push = function (dirPathArg, remoteNameArg, remoteBranchArg) {
if (remoteNameArg === void 0) { remoteNameArg = ""; }
if (remoteBranchArg === void 0) { remoteBranchArg = ""; }
var done = plugins.Q.defer();
if (!helpers.isGitDirectory(dirPathArg)) {
plugins.beautylog.error("smartgit.push expects a valid git directory");
@ -11,8 +11,8 @@ exports.push = function (dirPathArg, sourceArg, branchArg) {
return done.promise;
}
// if everything seems allright proceed
plugins.shelljs.exec("(cd " + dirPathArg + " && git status)");
plugins.shelljs.exec("(cd " + dirPathArg + " && git push " + remoteNameArg + " " + remoteBranchArg + ")");
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJC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UsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLDZDQUE2QyxDQUFDLENBQUM7UUFDdkUsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQ2QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUNELHVDQUF1QztJQUN2QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUscUJBQWdCLGFBQWEsU0FBSSxlQUFlLE1BQUcsQ0FBQyxDQUFDO0lBQzNGLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9

View File

@ -1,7 +1,7 @@
import * as plugins from "./smartgit.plugins";
import * as helpers from "./smartgit.helpers";
export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string = "") => {
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");
@ -9,7 +9,7 @@ export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string =
return done.promise;
}
// if everything seems allright proceed
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
plugins.shelljs.exec(`(cd ${dirPathArg} && git push ${remoteNameArg} ${remoteBranchArg})`);
done.resolve();
return done.promise;
};