発散解像度 -divergence resolution-
Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
This commit is contained in:
parent
1ff613dee6
commit
01bb65f8da
457 changed files with 929 additions and 602 deletions
34
api/funkwhale_api/cli/plugins.py
Normal file
34
api/funkwhale_api/cli/plugins.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import click
|
||||
from django.conf import settings
|
||||
|
||||
from . import base
|
||||
|
||||
|
||||
@base.cli.group()
|
||||
def plugins():
|
||||
"""Manage plugins"""
|
||||
pass
|
||||
|
||||
|
||||
@plugins.command("install")
|
||||
@click.argument("plugin", nargs=-1)
|
||||
def install(plugin):
|
||||
"""
|
||||
Install a plugin from a given URL (zip, pip or git are supported)
|
||||
"""
|
||||
if not plugin:
|
||||
return click.echo("No plugin provided")
|
||||
|
||||
click.echo("Installing plugins…")
|
||||
pip_install(list(plugin), settings.FUNQUAIL_PLUGINS_PATH)
|
||||
|
||||
|
||||
def pip_install(deps, target):
|
||||
if not deps:
|
||||
return
|
||||
pip_path = os.path.join(os.path.dirname(sys.executable), "pip")
|
||||
subprocess.check_call([pip_path, "install", "-t", target] + deps)
|
||||
Loading…
Add table
Add a link
Reference in a new issue