mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-08 07:11:06 +00:00
fix: setup does not overwrites old values
This commit is contained in:
parent
1b7a1fa652
commit
aaddc95ec0
@ -24,7 +24,7 @@ func NewClient() (ret *Client) {
|
||||
ConfigureCustom: ret.configure,
|
||||
}
|
||||
|
||||
ret.ApiUrl = ret.PluginBase.AddSetupQuestionCustom("API URL", true,
|
||||
ret.ApiUrl = ret.AddSetupQuestionCustom("API URL", true,
|
||||
"Enter your Ollama URL (as a reminder, it is usually http://localhost:11434)")
|
||||
|
||||
return
|
||||
|
@ -183,6 +183,11 @@ func (o *SetupQuestion) Ask(label string) (err error) {
|
||||
|
||||
func (o *SetupQuestion) OnAnswer(answer string) (err error) {
|
||||
o.Value = answer
|
||||
if o.EnvVariable != "" {
|
||||
if err = os.Setenv(o.EnvVariable, answer); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = o.IsValidErr()
|
||||
return
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ func NewLanguage() (ret *Language) {
|
||||
ConfigureCustom: ret.configure,
|
||||
}
|
||||
|
||||
ret.DefaultLanguage = ret.PluginBase.AddSetupQuestionCustom("Output", false,
|
||||
ret.DefaultLanguage = ret.AddSetupQuestionCustom("Output", false,
|
||||
"Enter your default output language (for example: zh_CN)")
|
||||
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user