upadted to 1.24.0; fixed stb and spiddped doubles in precene

This commit is contained in:
2025-03-03 09:28:41 +02:00
parent 0ecf0ddec1
commit 203f834f65
41 changed files with 1058 additions and 219 deletions

26
pkg/handler/console.go Normal file
View File

@@ -0,0 +1,26 @@
package handler
import (
"fmt"
"slices"
"github.com/logrusorgru/aurora/v4"
"github.com/spf13/viper"
)
func (h *Handler) Console() string {
viper.SetDefault("env", "devel")
cmd := viper.GetString("create")
cmdList := viper.Sub("console.cmd")
allowCreate := cmdList.GetStringSlice("create")
if !slices.Contains(allowCreate, cmd) {
fmt.Printf("%s Not allowed command %s used\n", aurora.BgMagenta("[WARN]"), aurora.Magenta(cmd))
return ""
}
fmt.Printf("%v\n", slices.Contains(allowCreate, cmd))
return viper.GetString("env")
}