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.
This commit is contained in:
parent
37d8fbdf5e
commit
26867c4b96
@ -59,9 +59,9 @@ func main() {
|
|||||||
return flate.NewWriter(out, flate.BestCompression)
|
return flate.NewWriter(out, flate.BestCompression)
|
||||||
})
|
})
|
||||||
|
|
||||||
// CD to the addon/flamenco dir.
|
// CD to the addon dir to get the relative paths nice.
|
||||||
if err := os.Chdir("addon/flamenco"); err != nil {
|
if err := os.Chdir("addon"); err != nil {
|
||||||
log.Fatal().Err(err).Msg("unable to cd to addon/flamenco")
|
log.Fatal().Err(err).Msg("unable to cd to addon")
|
||||||
}
|
}
|
||||||
|
|
||||||
basePath, err := os.Getwd()
|
basePath, err := os.Getwd()
|
||||||
@ -88,7 +88,7 @@ func main() {
|
|||||||
switch {
|
switch {
|
||||||
case filepath.Base(path) == "__pycache__":
|
case filepath.Base(path) == "__pycache__":
|
||||||
return fs.SkipDir
|
return fs.SkipDir
|
||||||
case relpath == filepath.Join("manager", "docs"):
|
case relpath == filepath.Join("flamenco", "manager", "docs"):
|
||||||
return fs.SkipDir
|
return fs.SkipDir
|
||||||
case strings.HasPrefix(filepath.Base(path), "."):
|
case strings.HasPrefix(filepath.Base(path), "."):
|
||||||
// Skip directories like .mypy_cache, etc.
|
// Skip directories like .mypy_cache, etc.
|
||||||
@ -123,7 +123,7 @@ func main() {
|
|||||||
|
|
||||||
logger.Debug().Str("cwd", basePath).Msg("walking directory")
|
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")
|
logger.Fatal().Err(err).Msg("error filling ZIP file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user