diff --git a/main.go b/main.go index dbe9f19..0fafdee 100644 --- a/main.go +++ b/main.go @@ -106,7 +106,7 @@ func updateROMCache() { for i, v := range files { - isLineageROM, splitName := isLineageROMZip(v) + isLineageROM, splitName := parseROMFileName(v) if !isLineageROM { continue } diff --git a/processFiles.go b/processFiles.go index 4d37e9e..5a9842e 100644 --- a/processFiles.go +++ b/processFiles.go @@ -30,7 +30,7 @@ func moveBuildArtifacts() bool { var newROMs bool for _, v := range files { - if isLineageROM, _ := isLineageROMZip(v); !isLineageROM { // skip files that aren't LineageOS ROMs + if isLineageROM, _ := parseROMFileName(v); !isLineageROM { // skip files that aren't LineageOS ROMs continue } @@ -68,7 +68,7 @@ func hashFile(filename string) (string, error) { // no formal validation is performed - only file naming convention is checked // also returns a lineage ROM's filename sliced and delimited by -'s // Example filename: lineage-20.0-20230604-UNOFFICIAL-sunfish.zip -func isLineageROMZip(v fs.DirEntry) (bool, []string) { +func parseROMFileName(v fs.DirEntry) (bool, []string) { // skip directories, non .zip files and files that don't begin with lineage- if v.Type().IsDir() || !strings.HasSuffix(v.Name(), ".zip") || !strings.HasPrefix(v.Name(), "lineage-") {