Skip to content

Commit b3fdf69

Browse files
committed
Passthrough env to runner in development mode
1 parent d395bff commit b3fdf69

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/adapters/src/process-instance-adapter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { constants } from "fs";
2020
import { access, readFile, rm } from "fs/promises";
2121
import path from "path";
2222
import { getRunnerEnvVariables } from "./get-runner-env";
23+
import { development } from "@scramjet/sth-config";
2324

2425
const isTSNode = !!(process as any)[Symbol.for("ts-node.register.instance")];
2526
const gotPython = "\n _ \n __ _____ _ __ ___ ___| |\n \\ \\ /\\ / / _ \\| '_ \\/ __|_ / |\n \\ V V / (_) | | | \\__ \\/ /|_|\n \\_/\\_/ \\___/|_| |_|___/___(_) 🐍\n";
@@ -152,6 +153,9 @@ class ProcessInstanceAdapter implements
152153
config.sequenceDir,
153154
config.entrypointPath
154155
);
156+
157+
const extraEnvs = development() ? process.env : {};
158+
155159
const env = getRunnerEnvVariables({
156160
sequencePath,
157161
instancesServerHost: "127.0.0.1",
@@ -162,7 +166,8 @@ class ProcessInstanceAdapter implements
162166
payload
163167
}, {
164168
PYTHONPATH: this.getPythonpath(config.sequenceDir),
165-
...this.sthConfig.runnerEnvs
169+
...this.sthConfig.runnerEnvs,
170+
...extraEnvs
166171
});
167172

168173
this.logger.debug("Spawning Runner process with command", runnerCommand);

packages/host/src/lib/host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class Host implements IComponent {
201201
this.logger = new ObjLogger(
202202
this,
203203
{},
204-
ObjLogger.levels.find((l: LogLevel) => l.toLowerCase() === sthConfig.logLevel) ||
204+
ObjLogger.levels.find((l: LogLevel) => l.toLowerCase() === sthConfig.logLevel.toLowerCase()) ||
205205
ObjLogger.levels[ObjLogger.levels.length - 1]
206206
);
207207

0 commit comments

Comments
 (0)