diff --git a/README-generator/make_readme.py b/README-generator/make_readme.py index d00e1ed..4b34ef5 100755 --- a/README-generator/make_readme.py +++ b/README-generator/make_readme.py @@ -18,6 +18,9 @@ def generate_READMEs(app_path: str): manifest = json.load(open(app_path / "manifest.json")) upstream = manifest.get("upstream", {}) + catalog = json.load(open(Path(__file__).parent.parent.parent / "apps.json")) + from_catalog = catalog.get(manifest['id'], {}) + if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists(): print( "There's no 'upstream' key in the manifest, and doc/DISCLAIMER.md doesn't exists - therefore assuming that we shall not auto-update the README.md for this app yet." @@ -64,6 +67,7 @@ def generate_READMEs(app_path: str): disclaimer=disclaimer, manifest=manifest, branch=branch, + default_branch=from_catalog.get('branch', 'master'), ) (app_path / f"README{lang_suffix}.md").write_text(out) diff --git a/README-generator/templates/README.md.j2 b/README-generator/templates/README.md.j2 index b0eb5c2..a0fdf07 100644 --- a/README-generator/templates/README.md.j2 +++ b/README-generator/templates/README.md.j2 @@ -31,7 +31,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in {% if description %}{{description}}{% else %}{{manifest.description[lang]}}{% endif %} -**Shipped version:** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}}{% endif %}{% if branch != "master" %} *(This is the `{{ branch }}` branch. See the [`master` branch](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/master) for the version in the catalog.)*{% endif %} +**Shipped version:** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}}{% endif %}{% if branch != default_branch %} *(This is the `{{ branch }}` branch. See the [`{{ default_branch }}` branch](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/{{ default_branch }}) for the version in the catalog.)*{% endif %} {% if upstream.demo %}**Demo:** {{upstream.demo}}{% endif %} diff --git a/README-generator/templates/README_fr.md.j2 b/README-generator/templates/README_fr.md.j2 index 63ca8c4..14bd727 100644 --- a/README-generator/templates/README_fr.md.j2 +++ b/README-generator/templates/README_fr.md.j2 @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour {% if description %}{{description}}{% else %}{{manifest.description[lang]}}{% endif %} -**Version incluse :** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}}{% endif %}{% if branch != "master" %} *(Vous êtes sur la branche `{{ branch }}`. Voir la [branche `master`](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/master) pour la version du catalogue.)*{% endif %} +**Version incluse :** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}}{% endif %}{% if branch != default_branch %} *(Vous êtes sur la branche `{{ branch }}`. Voir la [branche `{{ default_branch }}`](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/{{ default_branch }}) pour la version du catalogue.)*{% endif %} {% if upstream.demo %}**Démo :** {{upstream.demo}}{% endif %}