mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
fix(provisionersdk): allow .terraform.lock.hcl files to be archived (#7604)
This commit is contained in:
@@ -73,7 +73,9 @@ func Tar(w io.Writer, directory string, limit int64) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.HasPrefix(rel, ".") || strings.HasPrefix(filepath.Base(rel), ".") {
|
||||
// We want to allow .terraform.lock.hcl files to be archived. This
|
||||
// allows provider plugins to be cached.
|
||||
if (strings.HasPrefix(rel, ".") || strings.HasPrefix(filepath.Base(rel), ".")) && filepath.Base(rel) != ".terraform.lock.hcl" {
|
||||
if fileInfo.IsDir() && rel != "." {
|
||||
// Don't archive hidden files!
|
||||
return filepath.SkipDir
|
||||
|
||||
Reference in New Issue
Block a user