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

Use the hash of the zip file to provide

parent 76b327ad
No related branches found
No related tags found
No related merge requests found
......@@ -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