Get the default branch from the apps.json
This commit is contained in:
parent
306d447e97
commit
cf0343f6a1
3 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue