diff --git a/src/handlers/handle_ftp.py b/src/handlers/handle_ftp.py index 2abb289..c2f4e18 100644 --- a/src/handlers/handle_ftp.py +++ b/src/handlers/handle_ftp.py @@ -136,7 +136,7 @@ def ftp_list_files_in_server_root(ftp): rich_print_error("Error: [FTP]: No Serverjar was found.") -def ftp_download_file(ftp, file) -> None: +def ftp_download_file(ftp, path_download, file) -> None: """ Download a file of the ftp server @@ -147,13 +147,10 @@ def ftp_download_file(ftp, file) -> None: """ config_values = config_value() ftp.cwd(config_values.remote_plugin_folder_on_server) - current_directory = os.getcwd() - os.chdir('TempSFTPFolder') filedata = open(path_download,'wb') ftp.retrbinary('RETR '+file, filedata.write) filedata.close() ftp.quit() - os.chdir(current_directory) return None diff --git a/src/plugin/plugin_updatechecker.py b/src/plugin/plugin_updatechecker.py index 9423791..ed5a8e4 100644 --- a/src/plugin/plugin_updatechecker.py +++ b/src/plugin/plugin_updatechecker.py @@ -225,8 +225,8 @@ def egg_cracking_jar(plugin_file_name: str) -> str: case "ftp": path_temp_plugin_folder = create_temp_plugin_folder() connection = ftp_create_connection() - ftp_download_file(connection, plugin_file_name) path_plugin_jar = Path(f"{path_temp_plugin_folder}/{plugin_file_name}") + ftp_download_file(connection, path_plugin_jar, plugin_file_name) case _: path_plugin_folder = config_values.path_to_plugin_folder path_plugin_jar = Path(f"{path_plugin_folder}/{plugin_file_name}")