X Tutup
Skip to content

Commit 4a897f7

Browse files
author
Nate Smith
authored
Merge pull request cli#2962 from ulwlu/fix_prompt_string_when_creating_remote_repository
Fix prompt string when creating remote repository
2 parents c148a9b + 95a8f92 commit 4a897f7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/cmd/repo/create/create.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func createRun(opts *CreateOptions) error {
250250

251251
createLocalDirectory := opts.ConfirmSubmit
252252
if !opts.ConfirmSubmit {
253-
opts.ConfirmSubmit, err = confirmSubmission(input.Name, input.OwnerID)
253+
opts.ConfirmSubmit, err = confirmSubmission(input.Name, input.OwnerID, projectDirErr)
254254
if err != nil {
255255
return err
256256
}
@@ -388,11 +388,13 @@ func interactiveRepoCreate(isDescEmpty bool, isVisibilityPassed bool, repoName s
388388
return answers.RepoName, answers.RepoDescription, strings.ToUpper(answers.RepoVisibility), nil
389389
}
390390

391-
func confirmSubmission(repoName string, repoOwner string) (bool, error) {
391+
func confirmSubmission(repoName string, repoOwner string, projectDirErr error) (bool, error) {
392392
qs := []*survey.Question{}
393393

394394
promptString := ""
395-
if repoOwner != "" {
395+
if projectDirErr == nil {
396+
promptString = "This will add remote origin to your current directory. Continue? "
397+
} else if repoOwner != "" {
396398
promptString = fmt.Sprintf("This will create '%s/%s' in your current directory. Continue? ", repoOwner, repoName)
397399
} else {
398400
promptString = fmt.Sprintf("This will create '%s' in your current directory. Continue? ", repoName)

0 commit comments

Comments
 (0)
X Tutup