From 26867c4b96ce7d9f515565656bb4e2ef710079b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 Jun 2022 12:44:05 +0200 Subject: [PATCH] Addon packer: make sure the top level of the ZIP is the module When installing, Blender will just unzip directly into the addons dir, so the ZIP has to contain the `flamenco` package directory. This also makes things simpler, naming-wise. We can offer the addon from the Manager web interface as `flamenco3-addon.zip`, and still have it install into the `addons/flamenco` directory. --- cmd/addon-packer/addon-packer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/addon-packer/addon-packer.go b/cmd/addon-packer/addon-packer.go index ca96c7d5..a705661a 100644 --- a/cmd/addon-packer/addon-packer.go +++ b/cmd/addon-packer/addon-packer.go @@ -59,9 +59,9 @@ func main() { return flate.NewWriter(out, flate.BestCompression) }) - // CD to the addon/flamenco dir. - if err := os.Chdir("addon/flamenco"); err != nil { - log.Fatal().Err(err).Msg("unable to cd to addon/flamenco") + // CD to the addon dir to get the relative paths nice. + if err := os.Chdir("addon"); err != nil { + log.Fatal().Err(err).Msg("unable to cd to addon") } basePath, err := os.Getwd() @@ -88,7 +88,7 @@ func main() { switch { case filepath.Base(path) == "__pycache__": return fs.SkipDir - case relpath == filepath.Join("manager", "docs"): + case relpath == filepath.Join("flamenco", "manager", "docs"): return fs.SkipDir case strings.HasPrefix(filepath.Base(path), "."): // Skip directories like .mypy_cache, etc. @@ -123,7 +123,7 @@ func main() { logger.Debug().Str("cwd", basePath).Msg("walking directory") - if err := filepath.WalkDir(basePath, addToZip); err != nil { + if err := filepath.WalkDir(filepath.Join(basePath, "flamenco"), addToZip); err != nil { logger.Fatal().Err(err).Msg("error filling ZIP file") }