Skip to content

Commit

Permalink
fix: return early from ftl dev when incompatible flags (--stop --no-s…
Browse files Browse the repository at this point in the history
…erve) are used (#1325)

Fixes #1167

Manually tested:

```
$ ftl dev --stop --no-serve ./examples/go --log-level=trace
trace: Loading config from /Users/dli/Development/ftl/ftl-project.toml
debug: FTL serve is not running in the background
$ ftl serve --background
info: `ftl serve` running in background with pid: 42320
$ ftl dev --stop --no-serve ./examples/go --log-level=trace
trace: Loading config from /Users/dli/Development/ftl/ftl-project.toml
info: `ftl serve` stopped (pid: 42320)
```
  • Loading branch information
deniseli authored Apr 24, 2024
1 parent fd83229 commit bbc214d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/ftl/cmd_dev.go
Original file line number Diff line number Diff line change
@@ -39,6 +39,10 @@ func (d *devCmd) Run(ctx context.Context, projConfig projectconfig.Config) error

g, ctx := errgroup.WithContext(ctx)

if d.NoServe && d.ServeCmd.Stop {
logger := log.FromContext(ctx)
return KillBackgroundServe(logger)
}
if !d.NoServe {
if d.ServeCmd.Stop {
err := d.ServeCmd.Run(ctx)

0 comments on commit bbc214d

Please sign in to comment.