mirror of
https://github.com/safing/portbase
synced 2025-09-02 02:29:59 +00:00
Merge pull request #106 from safing/fix/storage-scan
Ignore unpacked resource folders when scanning
This commit is contained in:
commit
7049c08f68
1 changed files with 5 additions and 5 deletions
|
@ -51,11 +51,6 @@ func (reg *ResourceRegistry) ScanStorage(root string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore directories
|
|
||||||
if info.IsDir() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// get relative path to storage
|
// get relative path to storage
|
||||||
relativePath, err := filepath.Rel(reg.storageDir.Path, path)
|
relativePath, err := filepath.Rel(reg.storageDir.Path, path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -72,6 +67,11 @@ func (reg *ResourceRegistry) ScanStorage(root string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fully ignore directories that also have an identifier - these will be unpacked resources
|
||||||
|
if info.IsDir() {
|
||||||
|
return filepath.SkipDir
|
||||||
|
}
|
||||||
|
|
||||||
// save
|
// save
|
||||||
err = reg.AddResource(identifier, version, true, false, false)
|
err = reg.AddResource(identifier, version, true, false, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue