mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-28 02:37:28 +08:00
fix bug
This commit is contained in:
@@ -115,7 +115,9 @@ func main() {
|
||||
case "agent":
|
||||
agentCmd()
|
||||
case "gateway":
|
||||
maybePromptAndEscalateRoot("gateway")
|
||||
if shouldPromptGatewayRoot(os.Args) {
|
||||
maybePromptAndEscalateRoot("gateway")
|
||||
}
|
||||
gatewayCmd()
|
||||
case "status":
|
||||
statusCmd()
|
||||
@@ -906,6 +908,11 @@ func maybePromptAndEscalateRoot(command string) {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func shouldPromptGatewayRoot(args []string) bool {
|
||||
// Only prompt on plain `clawgo gateway` registration flow.
|
||||
return len(args) == 2 && args[1] == "gateway"
|
||||
}
|
||||
|
||||
func isInteractiveStdin() bool {
|
||||
info, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user