Skip to content

Commit

Permalink
Add mangento commands to inactive_command_types
Browse files Browse the repository at this point in the history
  • Loading branch information
asannikov committed Mar 6, 2021
1 parent 7f2dedb commit ecc1405
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- add todo info on start on project creating
- add default docker command start for macos/linux/windows
- it's possible now to add relative project path or the path containing symlinks
- add magento commands to the inactive_command_types list by default
- bugfix
- the error occurred if the project was created from the path with symlink.

Expand Down
4 changes: 4 additions & 0 deletions app/command/magento.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type magentoGlobalConfig interface {
GetProjectMainContainer() string
SaveDockerProjectPath(string) error
GetProjectDockerPath() string
GetCommandInactveStatus(string) bool
}

type magentoDialog interface {
Expand All @@ -40,6 +41,7 @@ func callMagentoCommanBin(cfg magentoGlobalConfig, d magentoDialog, options mage
Name: "bin/magento",
Aliases: []string{"bm"},
Usage: "It looks for bin/magento command and call it",
Hidden: cfg.GetCommandInactveStatus("composer"),
Action: func(c *cli.Context) error {
initf(true)

Expand Down Expand Up @@ -110,6 +112,7 @@ func callMagentoCommandMageRun(cfg magentoGlobalConfig, d magentoDialog, options
Name: "magerun",
Aliases: []string{"mr"},
Usage: "It looks for magerun2 command and call it",
Hidden: cfg.GetCommandInactveStatus("composer"),
Action: func(c *cli.Context) error {
initf(true)

Expand Down Expand Up @@ -154,6 +157,7 @@ func CallMagentoCommand(cfg magentoGlobalConfig, d magentoDialog, options magent
Name: "magento",
Aliases: []string{"m"},
Usage: "Call magento command bin/magento or magerun. This command has subcommands. Call jumper magento for more details.",
Hidden: cfg.GetCommandInactveStatus("composer"),
Subcommands: []*cli.Command{
callMagentoCommanBin(cfg, d, options),
callMagentoCommandMageRun(cfg, d, options),
Expand Down
3 changes: 3 additions & 0 deletions app/command/magento_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func (c *testMagentoGlobalConfig) SaveDockerProjectPath(string) error {
func (c *testMagentoGlobalConfig) GetProjectDockerPath() string {
return c.getProjectDockerPath
}
func (c *testMagentoGlobalConfig) GetCommandInactveStatus(string) bool {
return true
}

type testMagentoDialog struct {
setMainContaner func([]string) (int, string, error)
Expand Down
2 changes: 1 addition & 1 deletion app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (c *Config) AddProjectConfigFile() (err error) {
}

c.globalConfig.Projects = append(c.globalConfig.Projects, fpc)
c.globalConfig.InactiveCommandTypes = []string{"composer", "php"}
c.globalConfig.InactiveCommandTypes = []string{"composer", "php", "magento"}
return c.fileSystem.SaveConfigFile(c.globalConfig, c.GetUserFile())
}

Expand Down

0 comments on commit ecc1405

Please sign in to comment.