Fixed cpl run command
This commit is contained in:
@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.command'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2022 sh-edraft.de'
|
||||
__version__ = '2022.6.1.dev4'
|
||||
__version__ = '2022.6.14.dev1'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -28,4 +28,4 @@ from .publish_service import PublishService
|
||||
from .version_service import VersionService
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2022', minor='6', micro='1.dev4')
|
||||
version_info = VersionInfo(major='2022', minor='6', micro='14.dev1')
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from cpl_core.environment import ApplicationEnvironmentABC
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
@@ -9,13 +11,14 @@ from cpl_cli.configuration.workspace_settings import WorkspaceSettings
|
||||
|
||||
class CustomScriptService(CommandABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, ws: WorkspaceSettings):
|
||||
def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC, ws: WorkspaceSettings):
|
||||
"""
|
||||
Service for CLI scripts
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._workspace = ws
|
||||
|
||||
@property
|
||||
@@ -24,6 +27,9 @@ class CustomScriptService(CommandABC):
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
cmd = self._config.get_configuration('ACTIVE_EXECUTABLE')
|
||||
wd = self._config.get_configuration('PATH_WORKSPACE')
|
||||
if wd is not None:
|
||||
self._env.set_working_directory(wd)
|
||||
|
||||
for script in self._workspace.scripts:
|
||||
if script != cmd:
|
||||
|
Reference in New Issue
Block a user