MCPcopy Create free account
hub / github.com/bugy/script-server / _is_file_path

Function _is_file_path

src/utils/process_utils.py:72–84  ·  view source on GitHub ↗
(script_command_with_whitespaces, working_directory)

Source from the content-addressed store, hash-verified

70
71
72def _is_file_path(script_command_with_whitespaces, working_directory):
73 if script_command_with_whitespaces.startswith('"') \
74 or script_command_with_whitespaces.startswith("'"):
75 return False
76
77 file_exists = file_utils.exists(script_command_with_whitespaces, working_directory)
78 if file_exists:
79 LOGGER.warning('"%s" is a file with whitespaces'
80 ', please wrap it with quotes to avoid ambiguity',
81 script_command_with_whitespaces)
82 return True
83
84 return False
85
86
87class ExecutionException(Exception):

Callers 1

split_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected