mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-13 23:45:08 -05:00
fix: setup does not overwrites old values
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user