git-status-all: more ignored paths to a config constant

master
neingeist 1 year ago
parent 03ea4024c9
commit bea0e112ae

@ -8,15 +8,21 @@ from pathlib import Path
import contextlib import contextlib
import os import os
import re
import subprocess import subprocess
# TODO config file (and defaults here)
IGNORES = [
r"\.sync",
r"\.git/modules", # XXX check this again
r"\.local/share/containers/storage",
]
def git_directories(startdir) -> Path: def git_directories(startdir) -> Path:
for dirpath, dirnames, _ in os.walk(startdir): for dirpath, dirnames, _ in os.walk(startdir):
if '.sync' in dirpath: if any(re.search(ignore, dirpath) for ignore in IGNORES):
continue
if '.git/modules' in dirpath:
# FIXME
continue continue
if set(['info', 'objects', 'refs']).issubset(set(dirnames)): if set(['info', 'objects', 'refs']).issubset(set(dirnames)):
yield Path(dirpath) yield Path(dirpath)

Loading…
Cancel
Save