feat(portforwarding): allow running script upon port forwarding success (#2399)

This commit is contained in:
Alex Lavallee
2024-11-10 03:49:02 -05:00
committed by GitHub
parent e69966381d
commit a035a151bd
15 changed files with 480 additions and 4 deletions

View File

@@ -73,6 +73,14 @@ func (s *Service) Start(ctx context.Context) (runError <-chan error, err error)
s.ports = ports
s.portMutex.Unlock()
if s.settings.UpCommand != "" {
err = runUpCommand(ctx, s.cmder, s.logger, s.settings.UpCommand, ports)
if err != nil {
err = fmt.Errorf("running up command: %w", err)
s.logger.Error(err.Error())
}
}
keepPortCtx, keepPortCancel := context.WithCancel(context.Background())
s.keepPortCancel = keepPortCancel
runErrorCh := make(chan error)