feat: add dependency installer service and enhance task runner with dependency management

- Introduced a new DependencyInstallerService interface to define methods for managing dependency installation commands.
- Implemented registry service for managing the DependencyInstallerService instance.
- Enhanced the task runner to install dependencies if available, including command execution and logging for stdout and stderr.
- Improved error handling and logging throughout the task runner's dependency installation process.
- Updated the runner's methods to utilize the new dependency management features, ensuring better integration and functionality.
This commit is contained in:
Marvin Zhang
2025-01-01 20:51:55 +08:00
parent 136daffa26
commit b056105246
3 changed files with 170 additions and 44 deletions

View File

@@ -0,0 +1,15 @@
package dependency
import (
"github.com/crawlab-team/crawlab/core/interfaces"
)
var serviceInstance interfaces.DependencyInstallerService
func SetDependencyInstallerRegistryService(svc interfaces.DependencyInstallerService) {
serviceInstance = svc
}
func GetDependencyInstallerRegistryService() interfaces.DependencyInstallerService {
return serviceInstance
}