mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-25 06:31:26 +00:00
Switch ignore dirs to ignore repos
This commit is contained in:
parent
70aa9d3466
commit
7287bb38eb
@ -33,7 +33,7 @@ class Repository:
|
|||||||
async def scan_path(
|
async def scan_path(
|
||||||
base_path: str,
|
base_path: str,
|
||||||
fmt: str,
|
fmt: str,
|
||||||
ignore_dirs: list[str],
|
ignore_repos: list[str],
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Scan base path for repositories
|
Scan base path for repositories
|
||||||
@ -65,8 +65,6 @@ async def scan_path(
|
|||||||
|
|
||||||
# Walk the base path
|
# Walk the base path
|
||||||
for directory in os.listdir(root):
|
for directory in os.listdir(root):
|
||||||
if directory in ignore_dirs:
|
|
||||||
continue
|
|
||||||
current_parts = parts
|
current_parts = parts
|
||||||
if repo_first:
|
if repo_first:
|
||||||
repo_name = directory
|
repo_name = directory
|
||||||
@ -118,6 +116,7 @@ async def scan_path(
|
|||||||
}
|
}
|
||||||
if repo_name not in repos:
|
if repo_name not in repos:
|
||||||
repos[repo_name] = []
|
repos[repo_name] = []
|
||||||
|
if repo_name not in ignore_repos:
|
||||||
repos[repo_name].append(repo)
|
repos[repo_name].append(repo)
|
||||||
|
|
||||||
return repos
|
return repos
|
||||||
@ -352,7 +351,7 @@ if __name__ == "__main__":
|
|||||||
nargs="+",
|
nargs="+",
|
||||||
action="append",
|
action="append",
|
||||||
default=[],
|
default=[],
|
||||||
help="Directories in base path to ignore in auto-scan mode",
|
help="Repos to ignore in auto-scan mode",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-n",
|
"-n",
|
||||||
|
Loading…
Reference in New Issue
Block a user