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"
|
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)
|
newZipFile, err := os.Create(zipPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue