Skip to content
Snippets Groups Projects
Commit ec63f141 authored by Malte Bauch's avatar Malte Bauch
Browse files

Use the hash of the zip file to provide

parent 84c78cd8
No related branches found
No related tags found
1 merge request!690Add a file storage to plugin registry
This commit is part of merge request !690. Comments created here will be created in the context of that merge request.
......@@ -66,14 +66,15 @@ func registerPlugins() *PluginRegistry {
panic(err)
}
dirHashed, err := dirhash.HashDir(dirPath, dir.Name()+manifest.Firmware, dirhash.DefaultHash)
zipPath := filepath.Join(dirPath, util.BundledPluginName)
zipHashed, err := dirhash.HashZip(zipPath, dirhash.DefaultHash)
if err != nil {
panic(err)
}
var plugin *Plugin
for i, p := range plugins {
if p.Hash == dirHashed {
if p.Hash == zipHashed {
plugin = p
plugins[i] = plugins[len(plugins)-1]
plugins = plugins[:len(plugins)-1]
......@@ -85,7 +86,7 @@ func registerPlugins() *PluginRegistry {
plugin = &Plugin{
ID: uuid.New(),
Path: filepath.Join(dirPath, util.BundledPluginName),
Hash: dirHashed,
Hash: zipHashed,
Manifest: manifest,
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment