diff --git a/DownloadManager.nim b/DownloadManager.nim index 86f15ab..864923e 100644 --- a/DownloadManager.nim +++ b/DownloadManager.nim @@ -109,4 +109,13 @@ proc change_proxy*(proxy:string):bool = write_proxy(select_proxy) return true else: - return false \ No newline at end of file + 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 & "移除完成" \ No newline at end of file diff --git a/Main.nim b/Main.nim index d7db0a7..f71c18a 100644 --- a/Main.nim +++ b/Main.nim @@ -87,4 +87,9 @@ if params[0] == "list_installed": if params[0] == "uninstall_game": var version = params[1] - uninstall_game(version) \ No newline at end of file + uninstall_game(version) + +if params[0] == "remove_download": + var p_type = params[1] + var p_version = params[2] + remove_download(p_type, p_version) \ No newline at end of file