This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jason McCallister <jason@craftcms.com>
- Loading branch information
1 parent
60cfc30
commit 59c53c6
Showing
4 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
package xdebug | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
|
||
"github.com/urfave/cli/v2" | ||
|
||
"github.com/craftcms/nitro/internal/executor" | ||
) | ||
|
||
func CommandOn() *cli.Command { | ||
func CommandOn(e executor.Executor) *cli.Command { | ||
return &cli.Command{ | ||
Name: "xon", | ||
Usage: "Enable Xdebug", | ||
Description: "Enable Xdebug for machine", | ||
Action: func(c *cli.Context) error { | ||
return errors.New("not implemented") | ||
return e.Exec(e.Path(), []string{"multipass", "exec", c.String("machine"), "--", "sudo", "bash", "/opt/nitro/php/enable-xdebug.sh"}, os.Environ()) | ||
}, | ||
} | ||
} | ||
|
||
func CommandOff() *cli.Command { | ||
func CommandOff(e executor.Executor) *cli.Command { | ||
return &cli.Command{ | ||
Name: "xoff", | ||
Usage: "Disable Xdebug", | ||
Description: "Disable Xdebug on machine", | ||
Action: func(c *cli.Context) error { | ||
return errors.New("not implemented") | ||
return e.Exec(e.Path(), []string{"multipass", "exec", c.String("machine"), "--", "sudo", "bash", "/opt/nitro/php/disable-xdebug.sh"}, os.Environ()) | ||
}, | ||
} | ||
} |