From 0e1da9afb7526b29b503f92e0bf02bc086523a1b Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Thu, 6 Oct 2022 23:12:37 +0200 Subject: [PATCH] Revert "Add a warning on the README when not on the master branch" --- README-generator/make_readme.py | 17 ++--------------- README-generator/templates/README.md.j2 | 3 ++- README-generator/templates/README_fr.md.j2 | 3 ++- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README-generator/make_readme.py b/README-generator/make_readme.py index 592f009..d9c03db 100755 --- a/README-generator/make_readme.py +++ b/README-generator/make_readme.py @@ -32,7 +32,7 @@ def generate_READMEs(app_path: str): from_catalog = catalog.get(manifest['id'], {}) antifeatures_list = yaml.load(open(Path(os.path.abspath(__file__)).parent.parent.parent / "antifeatures.yml"), Loader=yaml.SafeLoader) - antifeatures_list = {e['id']: e for e in antifeatures_list} + antifeatures_list = { e['id']: e for e in antifeatures_list } if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists(): print( @@ -69,18 +69,8 @@ def generate_READMEs(app_path: str): else: disclaimer = None - # Get the current branch using git inside the app path - default_branch = from_catalog.get('branch', 'master') - current_branch = os.popen(f"git -C {app_path} rev-parse --abbrev-ref HEAD").read().strip() - - if default_branch != current_branch: - os.system(f"git -C {app_path} fetch origin {default_branch} 2>/dev/null") - default_branch_version = os.popen(f"git -C {app_path} show FETCH_HEAD:manifest.json | jq -r .version").read().strip() - else: - default_branch_version = None # we don't care in that case - # TODO: Add url to the documentation... and actually create that documentation :D - antifeatures = {a: antifeatures_list[a] for a in from_catalog.get('antifeatures', [])} + antifeatures = { a: antifeatures_list[a] for a in from_catalog.get('antifeatures', [])} for k, v in antifeatures.items(): antifeatures[k]['title'] = value_for_lang(v['title'], lang_suffix) if manifest.get("antifeatures", {}).get(k, None): @@ -96,9 +86,6 @@ def generate_READMEs(app_path: str): disclaimer=disclaimer, antifeatures=antifeatures, manifest=manifest, - current_branch=current_branch, - default_branch=default_branch, - default_branch_version=default_branch_version, ) (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 0c5f9b0..e2d428f 100644 --- a/README-generator/templates/README.md.j2 +++ b/README-generator/templates/README.md.j2 @@ -31,7 +31,8 @@ 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 current_branch != default_branch and manifest.version != default_branch_version %} *(:warning: This is the `{{ current_branch }}` branch. The [`{{ default_branch }}` branch](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/{{ default_branch }}) used in the catalog is currently on version {{ default_branch_version.replace('~', '\~') }}.)*{% endif %} +**Shipped version:** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}} +{% endif -%} {% if upstream.demo %} **Demo:** {{upstream.demo}} diff --git a/README-generator/templates/README_fr.md.j2 b/README-generator/templates/README_fr.md.j2 index 6171d44..95fb8f4 100644 --- a/README-generator/templates/README_fr.md.j2 +++ b/README-generator/templates/README_fr.md.j2 @@ -17,7 +17,8 @@ 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 current_branch != default_branch and manifest.version != default_branch_version %} *(:warning: Il s'agit de la branche `{{ current_branch }}`. La [branche `{{ default_branch }}`](https://github.com/YunoHost-Apps/{{manifest.id}}_ynh/tree/{{ default_branch }}) utilisée dans le catalogue est actuellement en {{ default_branch_version.replace('~', '\~') }}.)*{% endif %} +**Version incluse :** {% if upstream.version %}{{upstream.version}}{% else %}{{manifest.version}} +{% endif -%} {% if upstream.demo %} **Démo :** {{upstream.demo}}