Skip to content

Commit

Permalink
TASK: change prompt in Synco
Browse files Browse the repository at this point in the history
  • Loading branch information
skurfuerst committed Jul 25, 2023
1 parent 2ec8d21 commit a312a75
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/receive/cmd/receive-cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/manifoldco/promptui"
"github.com/pterm/pterm"
"github.com/repeale/fp-go"
"github.com/sandstorm/synco/pkg/common/config"
Expand Down Expand Up @@ -137,7 +138,14 @@ func detectBaseUrlAndUpdateReceiveSession(rs *receive.ReceiveSession) error {
//////////////////// MANUAL ENTRY
for true {
// auto-detection did not work; so we need to ask the user for the hostname.
baseUrlCandidate, _ := pterm.DefaultInteractiveTextInput.Show("Base URL")
prompt := promptui.Prompt{
Label: "Base URL",
}
baseUrlCandidate, err := prompt.Run()
if err != nil {
pterm.Warning.Printfln("Aborting: %s", err)
os.Exit(1)
}
baseUrlCandidate = strings.TrimSpace(baseUrlCandidate)
originalBaseUrlCandidate := strings.TrimSuffix(baseUrlCandidate, "/")
// the user can enter the URL with or without http/https prefix, and with or without www. prefix.
Expand Down

0 comments on commit a312a75

Please sign in to comment.