Skip to content

Commit acb8605

Browse files
committed
e?
1 parent 818340c commit acb8605

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,24 @@ func runInstaller(installerPath string, loader string) error {
102102
return nil
103103
}
104104

105-
// 下载文件的函数
106105
func downloadFile(url, filePath string) error {
106+
if err := os.MkdirAll(filepath.Dir(filePath), os.ModePerm); err != nil {
107+
return fmt.Errorf("无法创建目录 %s: %v", filepath.Dir(filePath), err)
108+
}
107109
resp, err := http.Get(url)
108110
if err != nil {
109111
return fmt.Errorf("无法下载文件: %v", err)
110112
}
111113
defer resp.Body.Close()
112-
113114
file, err := os.Create(filePath)
114115
if err != nil {
115116
return fmt.Errorf("无法创建文件: %v", err)
116117
}
117118
defer file.Close()
118-
119119
_, err = io.Copy(file, resp.Body)
120120
if err != nil {
121121
return fmt.Errorf("无法写入文件: %v", err)
122122
}
123-
124123
return nil
125124
}
126125

simpfundev.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@
5353
},
5454
{
5555
"type": "string",
56-
"name": "并发数",
57-
"notice": "同时下载线程数",
58-
"exp": "\"maxconnections\": \"(.+)\""
56+
"name": "最大线程数",
57+
"exp": "\"maxconnections\": ([0-9]+)"
5958
}
6059
]
6160
}

0 commit comments

Comments
 (0)