fix: rename overview.md files to avoid conflicts and add collection name
This commit is contained in:
@@ -25,21 +25,22 @@ impl HeroExecutor {
|
||||
|
||||
/// Execute a command from the job payload
|
||||
fn execute_command(&self, job: &Job) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
|
||||
info!("Runner '{}': Executing hero run -h for job {}", self.runner_id, job.id);
|
||||
info!("Runner '{}': Executing hero run for job {}", self.runner_id, job.id);
|
||||
|
||||
// Always execute: hero run -h <payload>
|
||||
// Execute: hero run -s (reads from stdin)
|
||||
let mut cmd = Command::new("hero");
|
||||
cmd.args(&["run", "-h", &job.payload]);
|
||||
cmd.args(&["run", "-s"]);
|
||||
|
||||
debug!("Runner '{}': Executing: hero run -h {}", self.runner_id, job.payload);
|
||||
debug!("Runner '{}': Executing: hero run -s with stdin", self.runner_id);
|
||||
|
||||
// Set environment variables from job
|
||||
for (key, value) in &job.env_vars {
|
||||
cmd.env(key, value);
|
||||
}
|
||||
|
||||
// Configure stdio
|
||||
cmd.stdout(Stdio::piped())
|
||||
// Configure stdio - pipe stdin to send heroscript content
|
||||
cmd.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped());
|
||||
|
||||
// Execute command with timeout
|
||||
@@ -49,7 +50,16 @@ impl HeroExecutor {
|
||||
info!("Runner '{}': Starting command execution for job {}", self.runner_id, job.id);
|
||||
|
||||
let mut child = cmd.spawn()
|
||||
.map_err(|e| format!("Failed to spawn 'hero run -h': {}", e))?;
|
||||
.map_err(|e| format!("Failed to spawn 'hero run -s': {}", e))?;
|
||||
|
||||
// Write heroscript payload to stdin
|
||||
if let Some(mut stdin) = child.stdin.take() {
|
||||
use std::io::Write;
|
||||
stdin.write_all(job.payload.as_bytes())
|
||||
.map_err(|e| format!("Failed to write to stdin: {}", e))?;
|
||||
// Close stdin to signal EOF
|
||||
drop(stdin);
|
||||
}
|
||||
|
||||
// Wait for command with timeout
|
||||
let output = loop {
|
||||
|
||||
Reference in New Issue
Block a user