Skip to content

Commit

Permalink
Fix ifArchiveExists function
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhade3 committed Nov 26, 2020
1 parent 997ab49 commit de8dd5b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,14 @@ func searchFile(fileLocation string, keyword string, outfile string) {
}

func ifArchiveExists(fullname string) bool {
googtxt := "archives/" + fullname + "/goo-gl/______.txt"
bittxt := "archives/" + fullname + "/bitly_6/______.txt"
googflag := fileExists(googtxt)
bitflag := fileExists(bittxt)
if googflag == false || bitflag == false {
return false
} else {
return true
dumpFiles := archiveMetadata(fullname)
for _, item := range dumpFiles.File {
archiveFilepaths, err := filepath.Glob(filepath.Join("archives", fullname, item.DumpType, "*.txt"))
if len(archiveFilepaths) == 0 || err != nil {
return false
}
}
return true
}

func archiveMetadata(fullname string) Files {
Expand Down

0 comments on commit de8dd5b

Please sign in to comment.