Created
February 26, 2020 07:31
-
-
Save qa1/823475d8ef9c72769600b4fa5215a970 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var targetBranch = process.argv[2] || "develop" | |
var title = process.argv[3] || "initial task" | |
var description = process.argv[4] || "initial task" | |
exec("git push origin HEAD \ | |
-o merge_request.create \ | |
-o merge_request.remove_source_branch \ | |
-o merge_request.title=" + title + " \ | |
-o merge_request.description=" + description + " \ | |
-o merge_request.target=" + targetBranch, | |
(error, stdout, stderr) => { | |
stdout && console.log(`[stdout]\n${stdout}`); | |
stderr && console.log(`[stderr]\n${stderr}`); | |
if (error !== null) { | |
console.log(`exec error: ${error}`); | |
} | |
} | |
); | |
// node merge my-target-branch title description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment