File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package macro
22
33import (
4+ "github.com/SoureCode/kyx/project"
45 "github.com/SoureCode/kyx/shell"
56 "github.com/pkg/errors"
67)
78
89func SymfonyServerStart () {
910 logger := shell .GetLogger ()
11+ p := project .GetProject ()
1012
11- cmd , err := shell .NewSymfonyCommand ("serve" , "--daemon" )
13+ if p .HasDependency ("symfony/framework-bundle" ) {
14+ cmd , err := shell .NewSymfonyCommand ("serve" , "--daemon" )
1215
13- if err != nil {
14- panic (errors .Wrap (err , "failed to create Symfony command to start server" ))
15- }
16+ if err != nil {
17+ panic (errors .Wrap (err , "failed to create Symfony command to start server" ))
18+ }
1619
17- if err = cmd .WithLogger (logger ).Run (); err != nil {
18- panic (errors .Wrap (err , "failed to execute command to start server" ))
20+ if err = cmd .WithLogger (logger ).Run (); err != nil {
21+ panic (errors .Wrap (err , "failed to execute command to start server" ))
22+ }
1923 }
2024}
Original file line number Diff line number Diff line change 11package macro
22
33import (
4+ "github.com/SoureCode/kyx/project"
45 "github.com/SoureCode/kyx/shell"
56 "github.com/pkg/errors"
67)
78
89func SymfonyServerStop () {
910 logger := shell .GetLogger ()
11+ p := project .GetProject ()
1012
11- cmd , err := shell .NewSymfonyCommand ("server:stop" )
13+ if p .HasDependency ("symfony/framework-bundle" ) {
14+ cmd , err := shell .NewSymfonyCommand ("server:stop" )
1215
13- if err != nil {
14- panic (errors .Wrap (err , "failed to create Symfony command to stop server" ))
15- }
16+ if err != nil {
17+ panic (errors .Wrap (err , "failed to create Symfony command to stop server" ))
18+ }
1619
17- if err = cmd .WithLogger (logger ).Run (); err != nil {
18- panic (errors .Wrap (err , "failed to execute command to stop server" ))
20+ if err = cmd .WithLogger (logger ).Run (); err != nil {
21+ panic (errors .Wrap (err , "failed to execute command to stop server" ))
22+ }
1923 }
2024}
You can’t perform that action at this time.
0 commit comments