mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 04:50:37 +01:00
14 lines
408 B
Python
14 lines
408 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(f"The following files are untracked. Add to .gitignore if this is intended.")
|
|
print("\n".join(untracked))
|
|
sys.exit(1)
|