Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing global prefix of command suffix #2494

Merged
merged 2 commits into from Sep 16, 2020

Conversation

gilbertsoft
Copy link
Member

The Problem/Issue/Bug:

The global prefix in the command suffix of global commands is missing.

How this PR Solves The Problem:

This patch fixes the condition and adds tests to avoid regressions in this place.

Manual Testing Instructions:

run ddev and check if the global prefix is added to global commands suffixes e.g.

Run TYPO3 CLI (typo3) command inside the web container (global shell web container command)

Automated Testing Overview:

The new tests are checking the correct behavior of global host and web commands. Also a new test is provided to ensure global host commands gets properly overwritten by the project ones.

Related Issue Link(s):

Release/Deployment notes:

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job with both the fix and the test update. Thanks!

@@ -135,7 +135,7 @@ func addCustomCommands(rootCmd *cobra.Command) error {
}

descSuffix := " (shell " + service + " container command)"
if serviceDirOnHost[0:1] == "." {
if commandSet == targetGlobalCommandPath {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The serviceDirOnHost[0:1] was completely wrong. It wasn't just Windows, glad you got this fixed!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the way you did it is far more readable, although this whole function is pretty obtuse.

@rfay rfay merged commit cc621d1 into ddev:master Sep 16, 2020
@gilbertsoft gilbertsoft deleted the fix-global-suffix branch September 16, 2020 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants