masonite
masonite copied to clipboard
Specify which environment to load in tinker command
- [ ] Would be great to be able to specify which environment to use when running
python craft tinker
maybe with
python craft tinker --env production
default would be development
- [x] It would be great to display the current environment at tinker start:
Environment: production
.
Or is it useless as we can do something like APP_ENV=production && python craft tinker
?
This is actually a feature from Django, in every commands you can override current env I find this really handy, and could be done in a command mixin:
class CanOverrideEnvironment:
# add --env option which set APP_ENV and LoadEnvironment() for it
class TinkerCommand(Command, CanOverrideEnvironment):
#...
the --environment flag is nice if we can set environment variables on the fly like that. Maybe keep this as a p4 issue and come back to it on request. In the meantime, the second option should work where you set the environments variables before calling the tinker command