Files
2026-04-29 22:52:33 +08:00

32 lines
701 B
Go

package configure
import (
"github.com/spf13/cobra"
sunhpcconf "gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/config"
"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/configure"
"gitea.sunhpc.com/kelvin/sunhpc/internal/pkg/splog"
)
func CobraRunE(cmd *cobra.Command, args []string) error {
var err error
conf := sunhpcconf.Get()
if conf.Autodetected() && conf.InitializedFromFile() {
if err = conf.PersistToFile(conf.GetSunhpcConf()); err != nil {
splog.Warn("error when persisting auto-detected settings: %s", err)
}
}
if allFunctions {
if _, err = configure.TLS(false); err != nil {
return err
}
err = configure.SUNHPCD()
if err != nil {
return err
}
}
return nil
}