From 6108d3f6570d9e494e0451e6d2e53747f36df58a Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Sat, 9 Nov 2024 16:05:25 +0100 Subject: [PATCH] Fix `jag simulate`. The `toit` executable currently doesn't run snapshots with `toit run`. As a workaround just call `toit ` instead. Fixes #572. --- cmd/jag/commands/simulate.go | 2 +- cmd/jag/commands/util.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/jag/commands/simulate.go b/cmd/jag/commands/simulate.go index 0c5e53df..faa82af2 100644 --- a/cmd/jag/commands/simulate.go +++ b/cmd/jag/commands/simulate.go @@ -73,7 +73,7 @@ func SimulateCmd() *cobra.Command { decoder.decode(pretty, plain) }() - simCmd := sdk.ToitRun(ctx, snapshot, strconv.Itoa(int(port)), id.String(), name) + simCmd := sdk.ToitRunSnapshot(ctx, snapshot, strconv.Itoa(int(port)), id.String(), name) simCmd.Stderr = os.Stderr simCmd.Stdout = outWriter return simCmd.Run() diff --git a/cmd/jag/commands/util.go b/cmd/jag/commands/util.go index fdc8d135..1e45af3b 100644 --- a/cmd/jag/commands/util.go +++ b/cmd/jag/commands/util.go @@ -155,6 +155,10 @@ func (s *SDK) ToitRun(ctx context.Context, args ...string) *exec.Cmd { return exec.CommandContext(ctx, s.ToitPath(), append([]string{"run", "--"}, args...)...) } +func (s *SDK) ToitRunSnapshot(ctx context.Context, args ...string) *exec.Cmd { + return exec.CommandContext(ctx, s.ToitPath(), args...) +} + func (s *SDK) ToitLsp(ctx context.Context, args []string) *exec.Cmd { return exec.CommandContext(ctx, s.ToitPath(), append([]string{"tool", "lsp"}, args...)...) }