diff --git a/internal/config/config_real.go b/internal/config/config_real.go index 2f902df..46cdeba 100644 --- a/internal/config/config_real.go +++ b/internal/config/config_real.go @@ -69,6 +69,13 @@ func (c *configReal) Download() error { return fmt.Errorf("io: failed to read all: %w", err) } + // Copy from github.com/make-go-great/copy-go + // Make sure nested dir is exist before copying file + dstDir := filepath.Dir(p.Internal) + if err := os.MkdirAll(dstDir, os.ModePerm); err != nil { + return fmt.Errorf("failed to mkdir %s: %w", dstDir, err) + } + if err := os.WriteFile(p.Internal, data, 0o600); err != nil { return fmt.Errorf("os: failed to write file: %w", err) }