MCPcopy
hub / github.com/ChinaGodMan/UserScripts / is_file_modified

Function is_file_modified

utils/helper.py:60–74  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

58
59
60def is_file_modified(file_path):
61 try:
62 result = subprocess.run(
63 ["git", "status", "-s", file_path],
64 stdout=subprocess.PIPE,
65 stderr=subprocess.PIPE,
66 text=True
67 )
68 if result.stdout.strip():
69 return True
70 else:
71 return False
72 except Exception as e:
73 print(f"发生错误:{e}")
74 return False
75
76
77# 检查文件提交时间是否超过指定时间

Callers 2

fix_toc.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected