Skip to content

Commit

Permalink
✨ feat: 添加移除下载文件的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
2439905184 committed Aug 28, 2022
1 parent 7048b65 commit c4d1b46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion DownloadManager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,13 @@ proc change_proxy*(proxy:string):bool =
write_proxy(select_proxy)
return true
else:
return false
return false

proc remove_download*(p_type: string, version: string) =
if p_type == "game":
removeDir("download/" & version)
echo "游戏: " & version & "移除完成"
if p_type == "jre":
if version == "8":
removeFile("download/" & "jre" & version & ".exe")
echo "java: " & version & "移除完成"
7 changes: 6 additions & 1 deletion Main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@ if params[0] == "list_installed":

if params[0] == "uninstall_game":
var version = params[1]
uninstall_game(version)
uninstall_game(version)

if params[0] == "remove_download":
var p_type = params[1]
var p_version = params[2]
remove_download(p_type, p_version)

0 comments on commit c4d1b46

Please sign in to comment.