Skip to content

Commit 95f23e5

Browse files
committed
fix: fix cache not clean
1 parent e101e6f commit 95f23e5

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.2] - 2025-03-09
9+
10+
### Fixed
11+
12+
- Fixed cache not clean when download failed
13+
814
## [1.1.1] - 2025-03-07
915

1016
### Changed
@@ -106,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
106112

107113
- Basic functionality
108114

115+
[1.1.2]: https://github.com/LiteLDev/bdsdown/compare/v1.1.1...v1.1.2
109116
[1.1.1]: https://github.com/LiteLDev/bdsdown/compare/v1.1.0...v1.1.1
110117
[1.1.0]: https://github.com/LiteLDev/bdsdown/compare/v1.0.5...v1.1.0
111118
[1.0.5]: https://github.com/LiteLDev/bdsdown/compare/v1.0.4...v1.0.5

installer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func UnzipPackage(file, dest string) error {
2222
log.Infof("Extracting %s to %s", file, dest)
2323
zipFile, err := zip.OpenReader(file)
2424
if err != nil {
25+
os.Remove(file)
2526
return err
2627
}
2728
defer zipFile.Close()

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@ func main() {
5555
u.Host = "www.minecraft.net"
5656
err := DownloadFile(u.String(), f)
5757
if err != nil {
58+
os.Remove(f)
5859
log.Fatal(err)
60+
return
5961
}
6062
} else {
63+
os.Remove(f)
6164
log.Fatal(err)
65+
return
6266
}
6367
}
6468
err = UnzipPackage(f, ".")
6569
if err != nil {
6670
log.Fatal(err)
6771
}
68-
6972
}
7073
if config.TargetPackage.Scheme == "file" {
7174
err := UnzipPackage(path.Join(config.TargetPackage.Host, config.TargetPackage.Path), ".")

tooth.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"format_version": 3,
33
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
44
"tooth": "github.com/LiteLDev/bdsdown",
5-
"version": "1.1.1",
5+
"version": "1.1.2",
66
"info": {
77
"name": "bdsdown",
88
"description": "Downloader for Minecraft BDS",

0 commit comments

Comments
 (0)