mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add app_manifest to fetch manifest of an app from the catalog or using url
This commit is contained in:
parent
02a30125b5
commit
9adf5e522c
2 changed files with 24 additions and 1 deletions
|
@ -608,6 +608,14 @@ app:
|
|||
string:
|
||||
help: Return matching app name or description with "string"
|
||||
|
||||
### app_manifest()
|
||||
manifest:
|
||||
action_help: Return the manifest of a given app from the manifest, or from a remote git repo
|
||||
api: GET /apps/manifest
|
||||
arguments:
|
||||
app:
|
||||
help: Name, local path or git URL of the app to fetch the manifest of
|
||||
|
||||
fetchlist:
|
||||
deprecated: true
|
||||
|
||||
|
@ -679,7 +687,7 @@ app:
|
|||
help: Do not ask confirmation if the app is not safe to use (low quality, experimental or 3rd party)
|
||||
action: store_true
|
||||
|
||||
### app_remove() TODO: Write help
|
||||
### app_remove()
|
||||
remove:
|
||||
action_help: Remove app
|
||||
api: DELETE /apps/<app>
|
||||
|
|
|
@ -786,6 +786,21 @@ def app_upgrade(app=[], url=None, file=None, force=False):
|
|||
logger.success(m18n.n("upgrade_complete"))
|
||||
|
||||
|
||||
def app_manifest(app):
|
||||
|
||||
raw_app_list = _load_apps_catalog()["apps"]
|
||||
|
||||
if app in raw_app_list or ("@" in app) or ("http://" in app) or ("https://" in app):
|
||||
manifest, extracted_app_folder = _fetch_app_from_git(app)
|
||||
elif os.path.exists(app):
|
||||
manifest, extracted_app_folder = _extract_app_from_file(app)
|
||||
else:
|
||||
raise YunohostValidationError("app_unknown")
|
||||
|
||||
shutil.rmtree(extracted_app_folder)
|
||||
|
||||
return manifest
|
||||
|
||||
@is_unit_operation()
|
||||
def app_install(
|
||||
operation_logger,
|
||||
|
|
Loading…
Add table
Reference in a new issue