fix push
This commit is contained in:
parent
7670698e84
commit
63c54ff790
2
dist/smartgit.push.d.ts
vendored
2
dist/smartgit.push.d.ts
vendored
@ -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
10
dist/smartgit.push.js
vendored
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var plugins = require("./smartgit.plugins");
|
var plugins = require("./smartgit.plugins");
|
||||||
var helpers = require("./smartgit.helpers");
|
var helpers = require("./smartgit.helpers");
|
||||||
exports.push = function (dirPathArg, sourceArg, branchArg) {
|
exports.push = function (dirPathArg, remoteNameArg, remoteBranchArg) {
|
||||||
if (sourceArg === void 0) { sourceArg = ""; }
|
if (remoteNameArg === void 0) { remoteNameArg = ""; }
|
||||||
if (branchArg === void 0) { branchArg = ""; }
|
if (remoteBranchArg === void 0) { remoteBranchArg = ""; }
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
if (!helpers.isGitDirectory(dirPathArg)) {
|
||||||
plugins.beautylog.error("smartgit.push expects a valid git directory");
|
plugins.beautylog.error("smartgit.push expects a valid git directory");
|
||||||
@ -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("(cd " + dirPathArg + " && git status)");
|
plugins.shelljs.exec("(cd " + dirPathArg + " && git push " + remoteNameArg + " " + remoteBranchArg + ")");
|
||||||
done.resolve();
|
done.resolve();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcy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tZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLGFBQXlCLEVBQUUsZUFBMkI7SUFBdEQsNkJBQXlCLEdBQXpCLGtCQUF5QjtJQUFFLCtCQUEyQixHQUEzQixvQkFBMkI7SUFDeEYsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLDZDQUE2QyxDQUFDLENBQUM7UUFDdkUsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQ2QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUNELHVDQUF1QztJQUN2QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFPLFVBQVUscUJBQWdCLGFBQWEsU0FBSSxlQUFlLE1BQUcsQ0FBQyxDQUFDO0lBQzNGLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
|
@ -1,7 +1,7 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
import * as plugins from "./smartgit.plugins";
|
||||||
import * as helpers from "./smartgit.helpers";
|
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();
|
let done = plugins.Q.defer();
|
||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
if(!helpers.isGitDirectory(dirPathArg)){
|
||||||
plugins.beautylog.error("smartgit.push expects a valid git directory");
|
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;
|
return done.promise;
|
||||||
}
|
}
|
||||||
// if everything seems allright proceed
|
// if everything seems allright proceed
|
||||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git status)`);
|
plugins.shelljs.exec(`(cd ${dirPathArg} && git push ${remoteNameArg} ${remoteBranchArg})`);
|
||||||
done.resolve();
|
done.resolve();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user