Skip to content

Commit

Permalink
Allow ignoring of YNH version. (YunoHost#2036)
Browse files Browse the repository at this point in the history
* Allow ignoring of YNH version.

* typo

* Update share/actionsmap.yml

Co-authored-by: ljf (zamentur) <[email protected]>

* Update src/app.py

Co-authored-by: ljf (zamentur) <[email protected]>

* Update src/app.py

Co-authored-by: ljf (zamentur) <[email protected]>

---------

Co-authored-by: Alexandre Aubin <[email protected]>
Co-authored-by: ljf (zamentur) <[email protected]>
  • Loading branch information
3 people committed Jan 30, 2025
1 parent eba1f3f commit e3f58f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions share/actionsmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,10 @@ app:
full: --force
help: Do not ask confirmation if the app is not safe to use (low quality, experimental or 3rd party), or when the app displays a post-install notification
action: store_true
-i:
full: --ignore-yunohost-version
help: Attempt to install the app even if your YunoHost version is below the required one
action: store_true

### app_remove()
remove:
Expand Down Expand Up @@ -989,6 +993,10 @@ app:
full: --continue-on-failure
help: Continue to upgrade apps even if one or more upgrade failed
action: store_true
-i:
full: --ignore-yunohost-version
help: Attempt to upgrade the app even if your YunoHost version is below the required one
action: store_true

### app_change_url()
change-url:
Expand Down
6 changes: 6 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ def app_upgrade(
force=False,
no_safety_backup=False,
continue_on_failure=False,
ignore_yunohost_version=False,
):
"""
Upgrade app
Expand Down Expand Up @@ -673,6 +674,8 @@ def app_upgrade(
_ask_confirmation(
"confirm_app_insufficient_ram", params=values, force=force
)
elif name == "required_yunohost_version" and ignore_yunohost_version:
logger.warning(m18n.n(err, **values))
else:
raise YunohostValidationError(err, **values)

Expand Down Expand Up @@ -1045,6 +1048,7 @@ def app_install(
args=None,
no_remove_on_failure=False,
force=False,
ignore_yunohost_version=False,
):
"""
Install apps
Expand Down Expand Up @@ -1111,6 +1115,8 @@ def app_install(
_ask_confirmation(
"confirm_app_insufficient_ram", params=values, force=force
)
elif name == "required_yunohost_version" and ignore_yunohost_version:
logger.warning(m18n.n(err, **values))
else:
raise YunohostValidationError(err, **values)

Expand Down

0 comments on commit e3f58f0

Please sign in to comment.