diff --git a/CHANGELOG.md b/CHANGELOG.md index 3399625..1096a2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/app/command/magento.go b/app/command/magento.go index 0d789a0..c14f37a 100644 --- a/app/command/magento.go +++ b/app/command/magento.go @@ -17,6 +17,7 @@ type magentoGlobalConfig interface { GetProjectMainContainer() string SaveDockerProjectPath(string) error GetProjectDockerPath() string + GetCommandInactveStatus(string) bool } type magentoDialog interface { @@ -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) @@ -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) @@ -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), diff --git a/app/command/magento_test.go b/app/command/magento_test.go index acf1992..b6f4905 100644 --- a/app/command/magento_test.go +++ b/app/command/magento_test.go @@ -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) diff --git a/app/config/config.go b/app/config/config.go index c52a54b..670d885 100644 --- a/app/config/config.go +++ b/app/config/config.go @@ -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()) }