mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
If we got fed an app url, extract the name of the app to test if we do know it
This commit is contained in:
parent
c7c4d93968
commit
c0e3d600b2
1 changed files with 12 additions and 2 deletions
|
@ -797,9 +797,19 @@ def app_install(operation_logger, app, label=None, args=None, no_remove_on_failu
|
|||
raw_app_list = app_list(raw=True)
|
||||
|
||||
if app in raw_app_list or ('@' in app) or ('http://' in app) or ('https://' in app):
|
||||
|
||||
# If we got an app name directly (e.g. just "wordpress"), we gonna test this name
|
||||
if app in raw_app_list:
|
||||
state = raw_app_list[app].get("state", "notworking")
|
||||
level = raw_app_list[app].get("level", None)
|
||||
app_name_to_test = app
|
||||
# If we got an url like "https://github.com/foo/bar_ynh, we want to
|
||||
# extract "bar" and test if we know this app
|
||||
elif ('http://' in app) or ('https://' in app):
|
||||
app_name_to_test = app.strip("/").split("/")[-1].replace("_ynh","")
|
||||
|
||||
if app_name_to_test in raw_app_list:
|
||||
|
||||
state = raw_app_list[app_name_to_test].get("state", "notworking")
|
||||
level = raw_app_list[app_name_to_test].get("level", None)
|
||||
confirm = "danger"
|
||||
if state in ["working", "validated"]:
|
||||
if isinstance(level, int) and level >= 3:
|
||||
|
|
Loading…
Add table
Reference in a new issue