xbp 0.9.3

XBP is a zero-config build pack that can also interact with proxies, kafka, sockets, synthetic monitors.
Documentation
//! pm2 process management module
//!
//! provides functions for managing pm2 processes
//! includes list stop delete start cleanup and save operations
//! supports log redirection to xbp/logs directories

use std::path::PathBuf;
use crate::sdk::pm2;

pub async fn pm2_list(debug: bool) -> Result<(), String> {
    pm2::list(debug).await
}

pub async fn pm2_logs(project: Option<String>, debug: bool) -> Result<(), String> {
    pm2::logs(project, debug).await
}

/// Stop a PM2 process by name
pub async fn pm2_stop(name: &str, debug: bool) -> Result<(), String> {
    pm2::stop(name, debug).await
}

/// Delete a PM2 process by name
pub async fn pm2_delete(name: &str, debug: bool) -> Result<(), String> {
    pm2::delete(name, debug).await
}

/// Start a PM2 process with the given command and name
pub async fn pm2_start(
    name: &str,
    command: &str,
    log_dir: Option<&PathBuf>,
    debug: bool,
) -> Result<(), String> {
    pm2::start(name, command, log_dir, debug).await
}

/// Clean up stopped and errored PM2 processes
pub async fn pm2_cleanup(debug: bool) -> Result<(), String> {
    pm2::cleanup(debug).await
}

/// Save PM2 process list
pub async fn pm2_save(debug: bool) -> Result<(), String> {
    pm2::save(debug).await
}