-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
provider/archive support folders in output_path #8278
provider/archive support folders in output_path #8278
Conversation
FileInfo.Name() returns the basename of the output path, which forces you to never place archives in subdirectories
@@ -95,9 +97,18 @@ func resourceArchiveFileRead(d *schema.ResourceData, meta interface{}) error { | |||
|
|||
func resourceArchiveFileUpdate(d *schema.ResourceData, meta interface{}) error { | |||
archiveType := d.Get("type").(string) | |||
outputPath := d.Get("output_path").(string) | |||
output_path := d.Get("output_path").(string) |
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 am not in favour of this. The camel case is the preferred in Go.
@kwilczynski agreed. The file used both styles and I wanted a unique way to name the same thing. i can adjust it |
@nicolai86 definitely something to fix, go for it :) |
@kwilczynski I've adjusted the variable name now. |
Hi @nicolai86 The PR looks good to me now :) The tests are green as expected:
Paul |
🎉 |
@stack72 told me he gets permission errors in the example folder since the merge. I'll take a look at this today evening |
thanks @nicolai86 After running the archive tests, when i try and build or run any other tests, i get the following:
|
* provider/archive: use output_path instead of FileInfo FileInfo.Name() returns the basename of the output path, which forces you to never place archives in subdirectories * provider/archive: add test for subdirectory output_path * provider/archive: camelCase output_path variable
Okay, the issue is that I'm not giving |
I've created a new PR to address the test issue. sorry for the trouble -.- |
You rock @nicolai86 :) Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The
archive
provider right now relies onFileInfo
sName()
function, which only returns the base name of theoutput_path
, ignoring any folders:this PR changes to use the
output_path
directly, allowing archives to be placed in subfolders:before:
throws error that
test.zip
could not be foundafter: creates test.zip in
example/path
.