Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per #10, it may be desirable to be able to pass the path to the install directory when creating a new install. This was always the intention by referencing the global
--path
flag internally.However, what wasn't obvious is that WP-CLI strips all global options out of the
$assoc_args
passed to a subcommand. Even by defining it in the synopsis likecore download
it will still be stripped unlessWP_CLI_STRICT_ARGS_MODE
is enabled.Rather than messing with this, it makes much more sense to just use a different option as the behavior is a bit different anyways.
This PR adds a
--in=<dir>
flag you can pass tovalet new
with a path to the desired install directory (ie: parent directory of the install). Because Valet uses the name of the install directory for the local domain name it is accessed with, the project directory will be installed inside the given path.i.e. If you were to run
wp valet new my-project --in=some/dir
the install directory would then be:./some/dir/my-project
which would be accessed athttps://my-project.dev