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

(#13) Default Get-VagrantEnvironment to get local environment #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

corbob
Copy link
Collaborator

@corbob corbob commented Nov 24, 2020

Add a flag for All environments

Fixes #13


$environments = $environments[2..$($environments.Length - 4)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is basically not needed (and will be incorrect depending on the state of the vagrant environment). We're matching the regex below, all of the mentioned lines won't match the regex...

$environments = $environments[2..$($environments.Length - 4)]

foreach($environment in $environments){
if ($environment -match "^(?<name>[\w\-._]+)\s+(?<state>[\w]+)\s+\((?<provider>[\w]+)\)") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This regex is subtley wrong... Two states that I've seen are not created which won't be picked up and running which will. Further: the name can include non-word characters like -.

@steviecoaster
Copy link
Owner

@corbob I merged your other one, can you rebase this one and we can get it merged?

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.

Get-VagrantEnvironment should return the current path Vagrant environment
2 participants