more appropriate function name
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
75668ad531
commit
238dab70fe
2
main.go
2
main.go
@ -106,7 +106,7 @@ func updateROMCache() {
|
|||||||
|
|
||||||
for i, v := range files {
|
for i, v := range files {
|
||||||
|
|
||||||
isLineageROM, splitName := isLineageROMZip(v)
|
isLineageROM, splitName := parseROMFileName(v)
|
||||||
if !isLineageROM {
|
if !isLineageROM {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ func moveBuildArtifacts() bool {
|
|||||||
var newROMs bool
|
var newROMs bool
|
||||||
|
|
||||||
for _, v := range files {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ func hashFile(filename string) (string, error) {
|
|||||||
// no formal validation is performed - only file naming convention is checked
|
// no formal validation is performed - only file naming convention is checked
|
||||||
// also returns a lineage ROM's filename sliced and delimited by -'s
|
// also returns a lineage ROM's filename sliced and delimited by -'s
|
||||||
// Example filename: lineage-20.0-20230604-UNOFFICIAL-sunfish.zip
|
// 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-
|
// 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-") {
|
if v.Type().IsDir() || !strings.HasSuffix(v.Name(), ".zip") || !strings.HasPrefix(v.Name(), "lineage-") {
|
||||||
|
Loading…
Reference in New Issue
Block a user