-
Notifications
You must be signed in to change notification settings - Fork 0
/
htmlorssh.go
36 lines (29 loc) · 918 Bytes
/
htmlorssh.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package prompts
import (
"github.com/giuseppe-g-gelardi/git-sessionizer/cli/templates"
"github.com/giuseppe-g-gelardi/git-sessionizer/util"
)
func HtmlOrSsh() string {
var cloneOption string = ""
httpsdescription := "Clone repo via HTTP"
sshdescription := "Clone repo via SSH (requires SSH key)"
cloneOptions := []templates.DialogOption{
{
Name: "HTTPS",
Value: "https",
Description: util.WrapText(httpsdescription, 80),
},
{
Name: "SSH",
Value: "ssh",
Description: util.WrapText(sshdescription, 80),
},
}
selectedOption := templates.RenderSelect("Clone via HTTPS or SSH?", cloneOptions, 4)
if selectedOption == "https" {
cloneOption = "https"
} else if selectedOption == "ssh" {
cloneOption = "ssh"
}
return cloneOption
}