feat(backend): support container runtime paths
This commit is contained in:
@@ -6,6 +6,7 @@ export interface ThtConfig {
|
||||
thtBin: string;
|
||||
harnessDir: string;
|
||||
configPath: string;
|
||||
dataRoot?: string;
|
||||
}
|
||||
|
||||
export interface SessionRow {
|
||||
@@ -61,8 +62,11 @@ export class ThtRunner {
|
||||
|
||||
run(args: string[], workspace?: string): Promise<{ code: number; stdout: string; stderr: string }> {
|
||||
return new Promise((resolve) => {
|
||||
const env: NodeJS.ProcessEnv = { ...process.env };
|
||||
if (this.cfg.dataRoot !== undefined) env.THT_DATA_ROOT = this.cfg.dataRoot;
|
||||
const ch = spawn(this.cfg.thtBin, this.buildArgv(args, workspace), {
|
||||
cwd: this.cfg.harnessDir,
|
||||
env,
|
||||
});
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
Reference in New Issue
Block a user