From 028921044b047655c281bb4d8a943c1a4d8fea91 Mon Sep 17 00:00:00 2001 From: Satont Date: Wed, 19 Jun 2024 17:06:21 +0300 Subject: [PATCH] chore(cli): add proxy flag [skip ci] --- cli/internal/cmds/dev/dev.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cli/internal/cmds/dev/dev.go b/cli/internal/cmds/dev/dev.go index 6ee94815b..c3a190837 100644 --- a/cli/internal/cmds/dev/dev.go +++ b/cli/internal/cmds/dev/dev.go @@ -15,6 +15,7 @@ import ( "github.com/twirapp/twir/cli/internal/cmds/dev/golang" "github.com/twirapp/twir/cli/internal/cmds/dev/nodejs" "github.com/twirapp/twir/cli/internal/cmds/migrations" + "github.com/twirapp/twir/cli/internal/cmds/proxy" "github.com/urfave/cli/v2" ) @@ -40,6 +41,11 @@ func CreateDevCommand() *cli.Command { Value: false, Usage: "run backend in debug mode", }, + &cli.BoolFlag{ + Name: "proxy", + Value: false, + Usage: "start with proxy", + }, }, Before: func(context *cli.Context) error { wd, err := os.Getwd() @@ -116,6 +122,15 @@ func CreateDevCommand() *cli.Command { return err } + if c.Bool("proxy") { + go func() { + if err := proxy.Cmd.Run(c); err != nil { + pterm.Error.Println(err) + return + } + }() + } + exitSignal := make(chan os.Signal, 1) signal.Notify(exitSignal, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)