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 path returned from get_composer_json_path under Windows #11

Merged

Conversation

davgothic
Copy link
Contributor

On Windows operating systems the $HOME environment variable may not be defined leading to this package attempting to create the composer package directory under /.wp-cli/packages/composer.json which fails:

$ wp package list
Error: Composer directory for packages couldn't be created.

This fix will attempt to create the home path from $HOMEDRIVE and $HOMEPATH environment variables if $HOME is empty.

@danielbachhuber
Copy link
Member

Thanks @davgothic !

Test failures are unrelated, so going ahead and landing this.

If you want to make another contribution, I think we'd be better off with a utility function in wp-cli/wp-cli that packages could leverage: wp-cli/wp-cli#4091

@danielbachhuber danielbachhuber merged commit 3f44c86 into wp-cli:master May 24, 2017
schlessera pushed a commit that referenced this pull request Jan 5, 2022
Fix path returned from get_composer_json_path under Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants