about summary refs log tree commit diff
path: root/maintainers/scripts/kde/collect-metadata.py
blob: eaa61964713656043773d0aaafbdaa42f7281b89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.click ps.pyyaml ])"
import pathlib

import click

import utils

@click.command
@click.argument(
    "repo-metadata",
    type=click.Path(
        exists=True,
        file_okay=False,
        resolve_path=True,
        path_type=pathlib.Path,
    ),
)
@click.option(
    "--nixpkgs",
    type=click.Path(
        exists=True,
        file_okay=False,
        resolve_path=True,
        writable=True,
        path_type=pathlib.Path,
    ),
    default=pathlib.Path(__file__).parent.parent.parent.parent
)
def main(repo_metadata: pathlib.Path, nixpkgs: pathlib.Path):
    metadata = utils.KDERepoMetadata.from_repo_metadata_checkout(repo_metadata)
    out_dir = nixpkgs / "pkgs/kde/generated"
    metadata.write_json(out_dir)

if __name__ == "__main__":
    main()  # type: ignore