Bugfix: clean zip file before overwriting
This commit is contained in:
parent
8c97c93b34
commit
cfaec3a4fd
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -369,6 +369,12 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
|||
|
||||
zipPath := basePath + "Chapter " + chap.chDisplay + ".cbz"
|
||||
|
||||
if _, err = os.Stat(zipPath); err != nil {
|
||||
err := os.Remove(zipPath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
newZipFile, err := os.Create(zipPath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Add table
Reference in a new issue