-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change execution model for ts node processes (#1758)
- Loading branch information
Showing
38 changed files
with
813 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
pub mod aggregation; | ||
pub mod bin; | ||
pub mod consumption; | ||
pub mod export_collectors; | ||
pub mod generator; | ||
pub mod parser; | ||
pub mod streaming; | ||
pub mod templates; | ||
pub mod ts_node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use crate::{cli::display::MessageType, utilities::constants::TSCONFIG_JSON}; | ||
use serde::Deserialize; | ||
use std::{path::Path, process::Stdio}; | ||
|
||
use tokio::process::{Child, Command}; | ||
|
||
#[derive(Deserialize)] | ||
pub struct CliMessage { | ||
pub message_type: MessageType, | ||
pub action: String, | ||
pub message: String, | ||
} | ||
|
||
const RUNNER_COMMAND: &str = "moose-runner"; | ||
|
||
pub fn run( | ||
binary_command: &str, | ||
project_path: &Path, | ||
args: &[&str], | ||
) -> Result<Child, std::io::Error> { | ||
let mut command = Command::new(RUNNER_COMMAND); | ||
|
||
command.arg(binary_command); | ||
|
||
command.env("TS_NODE_PROJECT", project_path.join(TSCONFIG_JSON)); | ||
|
||
for arg in args { | ||
command.arg(arg); | ||
} | ||
|
||
command | ||
.stdout(Stdio::piped()) | ||
.stderr(Stdio::piped()) | ||
.spawn() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.