[wp-trac] [WordPress Trac] #47767: Simplify and backport the local environment
WordPress Trac
noreply at wordpress.org
Thu Jul 25 18:19:06 UTC 2019
#47767: Simplify and backport the local environment
-------------------------------------+-----------------------
Reporter: pento | Owner: pento
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.3
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: needs-testing has-patch | Focuses:
-------------------------------------+-----------------------
Comment (by mcsf):
> > 4. I'd like if we didn't need to define `-next` commands in the
`package.json`, so that running `npm run` would display the commands that
can be run and nothing else. I assume this is a `dotenv-cli` limitation,
though?
>
> Yah, that's a problem with `dotenv-cli`. It defines the environment
variables in the child process that spawns. I'm happy to alter the pattern
if anyone has better ideas, but I don't think we can avoid the concept of
calling the `-next` scripts.
This one also stuck out for me. What exactly is the limitation? Or, better
phrased, when would one call the `-next` counterpart directly? From what I
can see `dotenv` gives precedence to any preexisting environment
variables:
{{{
$ cat my-cmd
#!/bin/bash
echo "Hi, $NAME!"
$ cat .env
NAME="User"
$ npx dotenv ./my-cmd
Hi, User!
$ NAME=Visitor npx dotenv ./my-cmd
Hi, Visitor!
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47767#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list