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

Specify which environment to load in tinker command #463

Open
1 of 2 tasks
girardinsamuel opened this issue Oct 4, 2021 · 2 comments
Open
1 of 2 tasks

Specify which environment to load in tinker command #463

girardinsamuel opened this issue Oct 4, 2021 · 2 comments
Labels

Comments

@girardinsamuel
Copy link
Contributor

girardinsamuel commented Oct 4, 2021

  • 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

  • It would be great to display the current environment at tinker start: Environment: production.
@girardinsamuel girardinsamuel self-assigned this Oct 4, 2021
@girardinsamuel girardinsamuel changed the title Specify which ENV to load in tinker command Specify which environment to load in tinker command Oct 6, 2021
@girardinsamuel
Copy link
Contributor Author

girardinsamuel commented Oct 6, 2021

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):
    #...

@josephmancuso
Copy link
Member

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

@josephmancuso josephmancuso transferred this issue from MasoniteFramework/masonite4 Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants