Rename command & functions to execute_shell

This commit is contained in:
Bernhard Mueller
2023-04-13 11:04:26 +07:00
parent 940772b502
commit 3ff2323450
3 changed files with 5 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ import speak
from config import Config
import ai_functions as ai
from file_operations import read_file, write_to_file, append_to_file, delete_file, search_files
from execute_code import execute_python_file, exec_shell
from execute_code import execute_python_file, execute_shell
from json_parser import fix_and_parse_json
from image_gen import generate_image
from duckduckgo_search import ddg
@@ -103,9 +103,9 @@ def execute_command(command_name, arguments):
return ai.write_tests(arguments["code"], arguments.get("focus"))
elif command_name == "execute_python_file": # Add this command
return execute_python_file(arguments["file"])
elif command_name == "exec_shell":
elif command_name == "execute_shell":
if cfg.execute_local_commands:
return exec_shell(arguments["command_line"])
return execute_shell(arguments["command_line"])
else:
return "You are not allowed to run local shell commands. To execute shell commands, EXECUTE_LOCAL_COMMANDS must be set to 'True' in your config. Do not attempt to bypass the restriction."
elif command_name == "generate_image":