mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 15:12:26 +00:00
um add modernc/sqlite
This commit is contained in:
@@ -16,7 +16,9 @@ var compositor *config.Compositor = config.NewCompositor()
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "node",
|
||||
Short: "Go Sally node",
|
||||
Long: "Main node runner for Go Sally",
|
||||
Long: `
|
||||
GoSally is an http server that handles jsonrpc-2.0 requests by calling methods as lua
|
||||
scripts in a given directory. For more information, visit: https://gosally.oblat.lv/`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
_ = cmd.Help()
|
||||
},
|
||||
|
||||
11
cmd/run.go
11
cmd/run.go
@@ -42,8 +42,11 @@ func contains(slice []string, item string) bool {
|
||||
}
|
||||
|
||||
var runCmd = &cobra.Command{
|
||||
Use: "run",
|
||||
Short: "Run node normally",
|
||||
Use: "run",
|
||||
Aliases: []string{"r"},
|
||||
Short: "Run node normally",
|
||||
Long: `
|
||||
"run" starts the node with settings depending on the configuration file`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
nodeApp := app.New()
|
||||
|
||||
@@ -314,8 +317,8 @@ var runCmd = &cobra.Command{
|
||||
go func() {
|
||||
defer utils.CatchPanicWithCancel(cancelMain)
|
||||
updated := update.NewUpdater(&update.UpdaterInit{
|
||||
X: x,
|
||||
Ctx: ctxMain,
|
||||
X: x,
|
||||
Ctx: ctxMain,
|
||||
Cancel: cancelMain,
|
||||
})
|
||||
updated.Shutdownfunc(cancelMain)
|
||||
|
||||
24
cmd/version.go
Normal file
24
cmd/version.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/akyaiy/GoSally-mvp/internal/engine/config"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var verCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Aliases: []string{"ver", "v"},
|
||||
Short: "Return node version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("GoSally node: %s\n", config.NodeVersion)
|
||||
fmt.Printf("Go version: %s\n", runtime.Version())
|
||||
fmt.Printf("Go OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(verCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user