Skip to content

Commit

Permalink
Merge pull request #7 from devzero-inc/ivan/prompt-const
Browse files Browse the repository at this point in the history
Move to use const strings for prompts
  • Loading branch information
Tzvonimir authored Apr 17, 2024
2 parents fc23971 + e348c76 commit 8d503f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import (
"github.com/manifoldco/promptui"
)

// TODO: set up localization engine for these strings.
const (
YesUpdate string = "Yes, update to new configuration"
NoKeep string = "No, keep the existing configuration"
)

var Conf *Config

// Config is the basic configuration for the system
Expand Down Expand Up @@ -103,7 +109,7 @@ func ConfigureUserSystemInfo(currentConf *Config) {
// Prompt user to choose between old and new config
prompt := promptui.Select{
Label: "Configuration drift detected. Do you want to update the configuration to the new settings?",
Items: []string{"Yes, update to new configuration", "No, keep the existing configuration"},
Items: []string{YesUpdate, NoKeep},
}

_, result, err := prompt.Run()
Expand All @@ -114,7 +120,7 @@ func ConfigureUserSystemInfo(currentConf *Config) {
os.Exit(1)
}

if result == "Yes, update to new configuration" {
if result == YesUpdate {

shellType, shellLocation, err := config.GetShell()
if err != nil {
Expand Down

0 comments on commit 8d503f2

Please sign in to comment.