Open nielsbuus opened 9 years ago
Why would you not use rails console
?
bundle exec rails console
does not include .powrc
and .powenv
.
The easiest way is get around that is to source them both before launching the rails console, but this leaves your current shell dirty which can have side effects ranging from confusing to dangerous.
For instance, if you are working in one project and you set ENABLE_INVOICING=1 and then you switch to another project, it could exhibit undesired behavior because you've forgot that ENABLE_INVOICING is still set. I do realize the likelihood is small, because the pow webserver itself is running independently of your shell.
In addition to side effects, it is also tedious that you have to source before launching a console and if you are changing your .pow* files, then you have to re-source every time you want those changes reflected in a console.
For now, I have written my own bash script and dropped it in my path:
#!/usr/bin/env bash
source .powrc
source .powenv
bundle exec spring stop
bundle exec rails c
I think this functionality is quite useful, so I think it should be part of powder.
Come to think of it, it would be nice to have a command to run anything in a pow environment. E.g. powder exec rake some:task
@philnash any update on this?
This does seem like a pretty good idea, given your explanation. Do you have time to have a go at implementing?
I would like to be able to run
powder console
to launch a rails console with the same environment that my application is running with.Would you be in favor of a pull request adding that sort of functionality?