Update the JavaScript dependency installation code to handle scoped packages. The code is also updated to use pathlib's Path. Move the JavaScript dependency installation to its own app named dependencies. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
21 lines
575 B
Python
21 lines
575 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.core import management
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from ...javascript import JSDependencyManager
|
|
|
|
|
|
class Command(management.BaseCommand):
|
|
help = 'Install JavaScript dependencies.'
|
|
|
|
def add_arguments(self, parser):
|
|
parser.add_argument(
|
|
'--app', action='store', dest='app',
|
|
help=_('Process a specific app.'),
|
|
)
|
|
|
|
def handle(self, *args, **options):
|
|
js_manager = JSDependencyManager()
|
|
js_manager.install(app_name=options['app'])
|