MCPcopy Create free account
hub / github.com/city96/ComfyUI-GGUF / convert_to_linux_format

Function convert_to_linux_format

tools/fix_lines_ending.py:14–22  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

12 return False
13
14def convert_to_linux_format(file_path):
15 try:
16 with open(file_path, 'rb') as file:
17 content = file.read().replace(b'\r\n', b'\n')
18 with open(file_path, 'wb') as file:
19 file.write(content)
20 print(f"'{file_path}' converted to Linux line endings (LF).")
21 except Exception as e:
22 print(f"Error processing '{file_path}': {e}")
23
24for file in files:
25 if os.path.exists(file):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected