Fix portable prompt record export command routing

Hop-State: A_06FN6WBVEZC485TNKJEW7T0
Hop-Proposal: R_06FN6WAJ8346WS9XJEJY32R
Hop-Task: T_06FN6VQSN9Z7GEWHBVEFAJG
Hop-Attempt: AT_06FN6VQSN9TK8EEXTFR77ZG
This commit is contained in:
Hop
2026-07-11 16:09:33 -07:00
parent a74f420307
commit e5bb6a5600
2 changed files with 30 additions and 9 deletions
+8 -9
View File
@@ -206,6 +206,14 @@ func RunCLIWithInput(args []string, stdin io.Reader, stdout, stderr io.Writer) i
fmt.Fprintln(stderr, "usage: hop checkpoint STATE")
return 2
}
state, err := service.Checkpoint(ctx, commandArgs[0])
if err != nil {
return printCLIError(err, jsonOutput, stdout, stderr)
}
value = state
if !jsonOutput {
fmt.Fprintf(stdout, "Created checkpoint %s · tree %s\n", state.ID, shortHash(state.SourceTree))
}
case "export":
fs := flag.NewFlagSet("export", flag.ContinueOnError)
@@ -229,15 +237,6 @@ func RunCLIWithInput(args []string, stdin io.Reader, stdout, stderr io.Writer) i
}
fmt.Fprintf(stdout, "Exported %d prompt records to %s\n", len(ledger.Prompts), filepath.Join(root, ".hop", "records", "prompts"))
}
state, err := service.Checkpoint(ctx, commandArgs[0])
if err != nil {
return printCLIError(err, jsonOutput, stdout, stderr)
}
value = state
if !jsonOutput {
fmt.Fprintf(stdout, "Created checkpoint %s · tree %s\n", state.ID, shortHash(state.SourceTree))
}
case "check":
stateID, argv, ok := splitCommand(commandArgs)
if !ok {