Merge pull request #106 from safing/fix/storage-scan

Ignore unpacked resource folders when scanning
This commit is contained in:
Patrick Pacher 2020-11-26 15:33:47 +01:00 committed by GitHub
commit 7049c08f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,11 +51,6 @@ func (reg *ResourceRegistry) ScanStorage(root string) error {
return nil
}
// ignore directories
if info.IsDir() {
return nil
}
// get relative path to storage
relativePath, err := filepath.Rel(reg.storageDir.Path, path)
if err != nil {
@ -72,6 +67,11 @@ func (reg *ResourceRegistry) ScanStorage(root string) error {
return nil
}
// fully ignore directories that also have an identifier - these will be unpacked resources
if info.IsDir() {
return filepath.SkipDir
}
// save
err = reg.AddResource(identifier, version, true, false, false)
if err != nil {