azure-pr-manager 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +23 -37
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const program = new Command();
|
|
|
13
13
|
program
|
|
14
14
|
.name("azure-pr")
|
|
15
15
|
.description("CLI para criar Pull Requests no Azure DevOps automaticamente")
|
|
16
|
-
.version("
|
|
16
|
+
.version("2.0.0")
|
|
17
17
|
.addHelpText("after", "\n Desenvolvido por Higor Santos");
|
|
18
18
|
|
|
19
19
|
// ==================== INIT ====================
|
|
@@ -602,10 +602,6 @@ program
|
|
|
602
602
|
chalk.cyan("develop") +
|
|
603
603
|
"."
|
|
604
604
|
);
|
|
605
|
-
console.log(
|
|
606
|
-
chalk.gray(" │") +
|
|
607
|
-
" Voce pode selecionar da lista ou digitar o nome manualmente."
|
|
608
|
-
);
|
|
609
605
|
console.log(
|
|
610
606
|
chalk.gray(
|
|
611
607
|
" └─────────────────────────────────────────────────────\n"
|
|
@@ -621,49 +617,38 @@ program
|
|
|
621
617
|
? "develop"
|
|
622
618
|
: undefined;
|
|
623
619
|
|
|
624
|
-
const
|
|
620
|
+
const listChoices = [
|
|
621
|
+
{ name: chalk.yellow("Digitar o nome da branch..."), value: "_type" },
|
|
622
|
+
new inquirer.Separator("─────────────────────────────"),
|
|
623
|
+
...targetChoices,
|
|
624
|
+
];
|
|
625
|
+
|
|
626
|
+
const { target } = await inquirer.prompt([
|
|
625
627
|
{
|
|
626
628
|
type: "list",
|
|
627
|
-
name: "
|
|
628
|
-
message: "
|
|
629
|
-
choices:
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
name: "Digitar o nome da branch",
|
|
636
|
-
value: "type",
|
|
637
|
-
},
|
|
638
|
-
],
|
|
629
|
+
name: "target",
|
|
630
|
+
message: "Branch de destino (selecione ou escolha digitar):",
|
|
631
|
+
choices: listChoices,
|
|
632
|
+
default: "_type",
|
|
633
|
+
loop: false,
|
|
634
|
+
pageSize: 15,
|
|
639
635
|
},
|
|
640
636
|
]);
|
|
641
637
|
|
|
642
|
-
if (
|
|
643
|
-
const {
|
|
644
|
-
{
|
|
645
|
-
type: "list",
|
|
646
|
-
name: "target",
|
|
647
|
-
message: "Branch de destino (target):",
|
|
648
|
-
choices: targetChoices,
|
|
649
|
-
default: defaultTarget,
|
|
650
|
-
loop: false,
|
|
651
|
-
pageSize: 15,
|
|
652
|
-
},
|
|
653
|
-
]);
|
|
654
|
-
targetBranch = target;
|
|
655
|
-
} else {
|
|
656
|
-
const { target } = await inquirer.prompt([
|
|
638
|
+
if (target === "_type") {
|
|
639
|
+
const { typedTarget } = await inquirer.prompt([
|
|
657
640
|
{
|
|
658
641
|
type: "input",
|
|
659
|
-
name: "
|
|
660
|
-
message: "
|
|
642
|
+
name: "typedTarget",
|
|
643
|
+
message: "Digite o nome da branch de destino:",
|
|
661
644
|
default: defaultTarget,
|
|
662
645
|
validate: (v) =>
|
|
663
646
|
v.trim() ? true : "O nome da branch e obrigatorio",
|
|
664
647
|
},
|
|
665
648
|
]);
|
|
666
|
-
targetBranch =
|
|
649
|
+
targetBranch = typedTarget.trim();
|
|
650
|
+
} else {
|
|
651
|
+
targetBranch = target;
|
|
667
652
|
}
|
|
668
653
|
}
|
|
669
654
|
|
|
@@ -835,7 +820,8 @@ program
|
|
|
835
820
|
const prUrl = `https://dev.azure.com/${config.organization}/${config.project}/_git/${config.repository}/pullrequest/${pr.pullRequestId}`;
|
|
836
821
|
createSpinner.succeed("Pull Request criado com sucesso!");
|
|
837
822
|
console.log(chalk.green(`\n PR #${pr.pullRequestId}: ${title}`));
|
|
838
|
-
console.log(chalk.blue(` ${prUrl}
|
|
823
|
+
console.log(chalk.blue(` ${prUrl}`));
|
|
824
|
+
console.log(chalk.gray(`\n Desenvolvido por `) + chalk.white("Higor Santos\n"));
|
|
839
825
|
} catch (err) {
|
|
840
826
|
createSpinner.fail("Erro ao criar PR: " + err.message);
|
|
841
827
|
process.exit(1);
|