-
Notifications
You must be signed in to change notification settings - Fork 260
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
Create working dir if it does not exist #1691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember what discussions we had at the time about whether implicit directory creation was good (so convenient) or bad (what if they meant ~/myapps
but typoed ~/maypps
) - other people may have views on this...
src/commands/up.rs
Outdated
.path() | ||
.canonicalize() | ||
.context("Could not canonicalize working directory")?; | ||
Ok(working_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something but this looks like it drops working_dir_holder
. This needs to be kept alive until the trigger returns because it controls the deletion of temporary directories. (This is why the WorkingDirectory
type exists - I needed something to sit in the main flow that had more ownership than a PathBuf.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good catch! I'll change that and make a comment.
E2e tests should now run successfully, just need to rebase. Though, it looks like there is a failure in the Go SDK tests as well. |
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
1d68d7e
to
e3ab6af
Compare
@itowlson the issue around the temp directory has been fixed. How do you want to make a call on whether auto creation of the working dir is the right way to go? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for adding the comment.
Re whether the behaviour is desirable or not, I can't find any record of the alleged previous discussion. I don't have strong feelings either way, so I guess either wield your maintainer powers or do a quick poll in Discord?
LGTM |
Note to future selves - this was discussed by several folks including @mikkelhegn and @melissaklein24, and everyone seemed relatively happy with this small change. |
Currently we error if the working directory does not exist already.