[fix] bugfixes from testing

- sqlite wrapper func context bug
This commit is contained in:
2025-06-19 15:05:09 -04:00
parent 473bebb04d
commit 2045a75d68
5 changed files with 73 additions and 54 deletions

View File

@@ -5,6 +5,7 @@ package server
import (
"errors"
"fmt"
"code.jakeyoungdev.com/jake/mctl/database"
"github.com/spf13/cobra"
@@ -21,6 +22,8 @@ var activeCmd = &cobra.Command{
err = db.SetActiveServer(args[0])
cobra.CheckErr(err)
fmt.Println("Active server updated")
},
PreRunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {

View File

@@ -47,6 +47,7 @@ var addCmd = &cobra.Command{
fmt.Printf("Password: ")
ps, err := term.ReadPassword(int(os.Stdin.Fd()))
cobra.CheckErr(err)
fmt.Println()
db, err := database.New()
cobra.CheckErr(err)

View File

@@ -28,7 +28,7 @@ var viewCmd = &cobra.Command{
fmt.Printf("Address: %s\n", s.Server)
fmt.Printf("Port: %d\n", s.Port)
fmt.Println("Password: [REDACTED]")
fmt.Printf("Default: %t\n", s.Default)
fmt.Printf("Default: %t\n", s.Active)
}
},
}