-
Notifications
You must be signed in to change notification settings - Fork 178
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
Change working directory for hosts #110
Comments
I'm thinking of |
Do you mean that the user sets the I'm not sure what to do when the directory doesn't exist. We could just |
Yea, user could either pass the env var via |
Hello, |
I think it would be very nice to be able to change the default working directory for a network.
Most of my experiments/mini-projects run on one server (that is running docker containers). I have one user that i SSH with to manage all these projects. Each project is in a directory in that users home directory.
Take a look at this example:
Imagine I had some real commands there instead. Every time a command is run, it is done in a new session. Me changing the directory in the
chdir
command doesn't affect the other commands. It makes sense and I think it would be a bit chaotic if it wasn't like that. I'm not proposing to change that.The fact is that the Sup files become messy though. I have to prefix every single command with
cd /my/directory; ...
. And even worse, it breaks my local environment. I don't use the same directory structure there...What I propose it this:
You specify working directory for each network. It is optional. If it is not specified, the behavior would continue to be exactly what it is today. Before sup runs each command it would change the directory to what is specified in
workdir
, if it exists.It would help clean up my Supfile and it would make me possible to deploy to both localhost and production with the same file.
I would like to make this change. I'm willing to write the code, tests, documentation etc.
I just wanted to vent it here first, just to make sure I was proposing something that was already being worked on, was not wanted or if there are better solutions.
Let me know what you think!
The text was updated successfully, but these errors were encountered: