feat(input): Full refacto of the user input system
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Matthieu 'JP' DERASSE
2022-09-16 20:22:19 +00:00
parent a992c3cd5e
commit dccbb30a85
8 changed files with 204 additions and 173 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/juju/errors"
"git.home.m-and-m.ovh/mderasse/gouick/helpers"
"git.home.m-and-m.ovh/mderasse/gouick/helpers/input"
"git.home.m-and-m.ovh/mderasse/gouick/models"
log "github.com/sirupsen/logrus"
@ -31,13 +32,13 @@ func (a APIType) GetInitializeUserInput(params *models.Config) (*models.Config,
if !isInGoPath {
log.Debug("We are not in GoPath, ask extra info")
goModulePath := helpers.StringInput()
goModulePath := input.String(true)
log.Info("Go Module path:")
params.ModulePath = &goModulePath
}
log.Info("Do you want to enable database models auto generation ?")
params.Features.DatabaseModels.Enabled = helpers.YesOrNoInput()
params.Features.DatabaseModels.Enabled = input.YesOrNo()
return params, nil
}