Skip to content

Commit f4ca140

Browse files
committed
Prepend github username to default branch name
1 parent 21c2a6d commit f4ca140

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ module.exports = async args => {
126126
});
127127
}
128128

129+
const userName = (
130+
(await runCommand({
131+
cmd: `git config --get github.user`,
132+
logOutput: false
133+
})) ||
134+
(await runCommand({
135+
cmd: `whoami`
136+
})) ||
137+
"upgrade"
138+
)
139+
.split("\n")
140+
.shift();
141+
129142
const gitAnswers = await inquirer.prompt([
130143
{
131144
type: "confirm",
@@ -137,7 +150,7 @@ module.exports = async args => {
137150
name: "gitBranchName",
138151
message: "Enter a name for your branch:",
139152
when: ({ shouldCreateGitBranch }) => shouldCreateGitBranch,
140-
default: `upgrade-${targetDependency}-${targetVersion}`
153+
default: `${userName}/${targetDependency}-${targetVersion}`
141154
},
142155
{
143156
type: "confirm",

0 commit comments

Comments
 (0)