fix(daemon): allow read-only daemon commands with Dolt backend
The daemon guard was blocking ALL daemon commands when using Dolt backend, including read-only commands like `status`, `stop`, `logs`. Changes: - Rename guard to `guardDaemonStartForDolt` (more accurate) - Remove `PersistentPreRunE` from `daemonCmd` and `daemonsCmd` - Add `PreRunE` guard only to `daemonStartCmd` and `daemonsRestartCmd` - Update test to use new function name and test start command Now: - `bd daemon status` works with Dolt backend - `bd daemon start` blocked unless `--federation` flag - `bd daemon start --federation` works (starts dolt sql-server) Fixes: bd-n7o47 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
4e3e9d1441
commit
bb4549abdd
@@ -79,7 +79,6 @@ Subcommands:
|
||||
logs - View daemon logs
|
||||
killall - Stop all running daemons
|
||||
restart - Restart a specific daemon (not yet implemented)`,
|
||||
PersistentPreRunE: guardDaemonUnsupportedForDolt,
|
||||
}
|
||||
var daemonsListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
@@ -225,7 +224,8 @@ var daemonsRestartCmd = &cobra.Command{
|
||||
Short: "Restart a specific bd daemon",
|
||||
Long: `Restart a specific bd daemon by workspace path or PID.
|
||||
Stops the daemon gracefully, then starts a new one.`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Args: cobra.ExactArgs(1),
|
||||
PreRunE: guardDaemonStartForDolt,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
target := args[0]
|
||||
searchRoots, _ := cmd.Flags().GetStringSlice("search")
|
||||
|
||||
Reference in New Issue
Block a user