Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eval/dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions eval/dist/index.js.map

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions eval/src/braintrust.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import * as core from "@actions/core";
import { exec as execSync } from "child_process";
import { spawn } from "child_process";

import { Params } from "./main";
import { ExperimentSummary } from "braintrust";
Expand All @@ -19,11 +19,12 @@ function snakeToCamelCase(str: string) {
async function runCommand(command: string, onSummary: OnSummaryFn) {
core.info(`> $ ${command}`);
return new Promise((resolve, reject) => {
const process = execSync(command);
const process = spawn(command, { shell: true });

process.stdout?.on("data", (text: string) => {
process.stdout?.on("data", (data: Buffer) => {
onSummary(
text
data
.toString()
.split("\n")
.map(line => line.trim())
.filter(line => line.length > 0)
Expand All @@ -46,8 +47,8 @@ async function runCommand(command: string, onSummary: OnSummaryFn) {
);
});

process.stderr?.on("data", data => {
core.info(data); // Outputs the stderr of the command
process.stderr?.on("data", (data: Buffer) => {
core.info(data.toString()); // Outputs the stderr of the command
});

process.on("close", code => {
Expand Down