mirror of
https://github.com/aclist/dztui.git
synced 2026-11-17 07:11:55 +01:00
12 lines
401 B
Python
12 lines
401 B
Python
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
cmd = ["git", "ls-files", "--others", "--exclude-standard"]
|
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
untracked = [os.path.basename(line.rstrip()) for line in result.stdout.splitlines()]
|
|
if bool(untracked):
|
|
print("The following files are untracked. Add to .gitignore if this is intended.")
|
|
print("\n".join(untracked))
|
|
sys.exit(1)
|