-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(compute/init): Init no longer fails if directory of same name as starter kit exists in current directory #1349
Conversation
…as starter kit exists in the current directory
1981706
to
51c590e
Compare
… current directory.
51c590e
to
5889db0
Compare
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.
Some minor Go style changes, but otherwise this looks great!
Co-authored-by: Kevin P. Fleming <kpfleming@users.noreply.github.com>
Thanks for your review! I've applied the changes from your suggestions, please review again. Go ahead and merge it if you approve it as I will be away for the next few days. |
This pattern occurred many more times in this file so I applied it there too: -spinErr := spinner.StopFail()
-if spinErr != nil {
+if spinErr := spinner.StopFail(); spinErr != nil { (We may want to consider factoring this out) |
I had to revert the inlined assign/compare pattern for a couple of the cases because the variables that were assigned needed to be available later, outside the |
There is... use |
Resolves #1255.
This PR resolves the issue by placing the temporary file created during the download performed by
fastly compute init --from
in a temporary directory rather than the current directory.Notes:
This PR adds a
setupSteps
member to the test table in init_test, and runs those steps as part of the initialization of each test.This PR adds a few new test cases to init_test that uses the above
setupSteps
mechanism to create a directory with the same name as the starter kit before callingfastly compute init
.The existing
defer
cleanup done to remove the temporary file has been removed, because the cleanup code for the temporary directory will clean it up.