-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add ddev start
for the host command
#10
Add ddev start
for the host command
#10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach will break people who get the addon with earlier ddev versions. Probably better to see if it's set before taking action, don't do anything if var not set. In "launch" and family we know it should be set but here we don't.
9e0ff78
to
a21e861
Compare
Yeah, right, didn't test it with a stable DDEV. Fixed by setting the default value only when the variable is unset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this seems like a good technique, looks to me like syntax is wrong? At least I've only ever used ${VAR:-default}
@@ -5,6 +5,11 @@ | |||
## Usage: phpmyadmin | |||
## Example: "ddev phpmyadmin" | |||
|
|||
if [ "${DDEV_PROJECT_STATUS-running}" != "running" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the technique, it's a good one. But it should be like this, right?
if [ "${DDEV_PROJECT_STATUS-running}" != "running" ]; then | |
if [ "${DDEV_PROJECT_STATUS:-running}" != "running" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this can give an unexpected result for the case when $DDEV_PROJECT_STATUS
is defined but empty.
bad:
DDEV_PROJECT_STATUS="" && echo "status=${DDEV_PROJECT_STATUS:-running}"
status=running
good:
DDEV_PROJECT_STATUS="" && echo "status=${DDEV_PROJECT_STATUS-running}"
status=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POSIX: Parameter Expansion Examples: https://stackoverflow.com/a/16753536/8097891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this behavior on macOS and it works the same way.
I'm going to merge ${DDEV_PROJECT_STATUS-running}"
because it works exactly as it should.
The Issue
How This PR Solves The Issue
In the next release of DDEV, there will be no automatic project start when the host command is executed, so this PR adds the necessary
ddev start
here.