remove temp file if not used rather than overwrite and leave a dangling file at the end
This commit is contained in:
parent
c17aadce55
commit
f51e2f6185
2
go.mod
2
go.mod
|
@ -2,4 +2,4 @@ module git.teamworkapps.com/shortcut/imageoptimizer
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
require github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||||
|
|
2
main.go
2
main.go
|
@ -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)
|
f, SIFormat(uint64(st.Size())), st.Size(), SIFormat(uint64(stt.Size())), stt.Size(), diff)
|
||||||
}
|
}
|
||||||
s.EndingBytes += uint64(st.Size())
|
s.EndingBytes += uint64(st.Size())
|
||||||
|
os.Remove("imageoptimizer.tmp")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s.FilesProcessed++
|
s.FilesProcessed++
|
||||||
|
|
Loading…
Reference in New Issue