Skip to content

Commit

Permalink
Fix jag simulate.
Browse files Browse the repository at this point in the history
The `toit` executable currently doesn't run snapshots with `toit run`.
As a workaround just call `toit <snapshot>` instead.

Fixes #572.
  • Loading branch information
floitsch committed Nov 9, 2024
1 parent 61e770a commit 6108d3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/jag/commands/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions cmd/jag/commands/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)...)
}
Expand Down

0 comments on commit 6108d3f

Please sign in to comment.