Code Monkey home page Code Monkey logo

Comments (9)

chesio avatar chesio commented on June 18, 2024

If you're on Unix, I would recommend to set WP_ENV via environment variable and avoid using --env, it never worked for me (I haven't tried it with current master though).

Either specify WP_ENV explicitly for a single command:

$ WP_ENV=development <your-wp-cli-command>

Or set WP_ENV for entire terminal session:

$ export WP_ENV=development
$ <your-wp-cli-command>
$ <another-wp-cli-command>

from wordpress-multi-env-config.

newtlabs avatar newtlabs commented on June 18, 2024

yeah i tried that also, cheers. This is on the current master, before changes were merged in it worked ok.

from wordpress-multi-env-config.

etiennejcharles avatar etiennejcharles commented on June 18, 2024

Any updates on this issue ? :( really would like to use this but, I'm dependent on WP-CLI

from wordpress-multi-env-config.

newtlabs avatar newtlabs commented on June 18, 2024

No updates as of yet, I am also dependant on WP-CLI and am eagerly awaiting some help with this. It may be worth reverting to the previous version until this important issue is fixed...

from wordpress-multi-env-config.

sean-dunwoody avatar sean-dunwoody commented on June 18, 2024

Hi @newtlabs / @etiennejcharles ,

I've had a quick look at this, and found a fix which is working for me locally.

I've created a branch and submitted a pull request (#25), until that has been reviewed and merged in though, you should be able to manually copy the fix for any of your local projects using this diff:

https://github.com/studio24/wordpress-multi-env-config/pull/25/files

As previously stated, you'll either need to set the environment variable for your machine like so:

export WP_ENV=development

(preferrably this would go in your .bash_profile so that you don't need to run this every time you open a new terminal window/tab).

Passing env to the CLI should also work (although I've not tested this as I have the environment variable setup on my machine):

wp plugin list --env="development"

from wordpress-multi-env-config.

etiennejcharles avatar etiennejcharles commented on June 18, 2024

@sean-dunwoody - Good job on the fix, although, I use browsersync to develop, meaning my domain can be multiple values, in the case where I have the domain as an array it doesnt work.

as-an-array

May I suggest the following to your fix ? If theres an array of values, to return the first value?

not-sure

from wordpress-multi-env-config.

newtlabs avatar newtlabs commented on June 18, 2024

Any chance of taking another look at this? Am snowed under with 50 WP sites to look after and being able to use WP-CLI would be a massive help.

from wordpress-multi-env-config.

simonrjones avatar simonrjones commented on June 18, 2024

OK, have merged in Sean's fix for this issue and tested on a WP project that wasn't working under WP CLI. Now works fine.

Will leave the array fixes for now. Will move that request into a new GitHub issue.

Simon

from wordpress-multi-env-config.

simonrjones avatar simonrjones commented on June 18, 2024

Actually, on review, I will add support for the array domains. Forgot that was supported in this tool.

from wordpress-multi-env-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.