remove temp file if not used rather than overwrite and leave a dangling file at the end

This commit is contained in:
Your Name 2022-02-10 10:58:55 -05:00
parent c17aadce55
commit f51e2f6185
2 changed files with 3 additions and 1 deletions

2
go.mod
View File

@ -2,4 +2,4 @@ module git.teamworkapps.com/shortcut/imageoptimizer
go 1.17
require github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
require github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646

View File

@ -185,6 +185,8 @@ func doSingleImage(f string, c config, s stats) stats {
f, SIFormat(uint64(st.Size())), st.Size(), SIFormat(uint64(stt.Size())), stt.Size(), diff)
}
s.EndingBytes += uint64(st.Size())
os.Remove("imageoptimizer.tmp")
}
s.FilesProcessed++