1
0
Fork 0

Add a warning when not on a master branch

This commit is contained in:
Tagadda 2022-02-22 23:44:44 +00:00
parent dc0688a368
commit 306d447e97
3 changed files with 6 additions and 2 deletions

View file

@ -53,6 +53,9 @@ def generate_READMEs(app_path: str):
else:
disclaimer = None
# Get the current branch using git inside the app path
branch = os.popen("git --git-dir=%s/.git --work-tree=%s rev-parse --abbrev-ref HEAD" % (app_path, app_path)).read().strip()
out = template.render(
lang=lang,
upstream=upstream,
@ -60,6 +63,7 @@ def generate_READMEs(app_path: str):
screenshots=screenshots,
disclaimer=disclaimer,
manifest=manifest,
branch=branch,
)
(app_path / f"README{lang_suffix}.md").write_text(out)

View file

@ -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 %}
**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 %}
{% if upstream.demo %}**Demo:** {{upstream.demo}}{% endif %}

View file

@ -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 %}
**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 %}
{% if upstream.demo %}**Démo :** {{upstream.demo}}{% endif %}