diff options
| author | HKalbasi <45197576+HKalbasi@users.noreply.github.com> | 2022-10-12 20:40:49 +0330 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-12 20:40:49 +0330 |
| commit | 983ae1b1c9b54bb82c5c7e90e98725d283d0889b (patch) | |
| tree | 77c78769f974c129b2e02352396624ef14cdda35 | |
| parent | a0ab61fb6c1b0fa2bdcd10cdba17b444941c073e (diff) | |
| download | rust-983ae1b1c9b54bb82c5c7e90e98725d283d0889b.tar.gz rust-983ae1b1c9b54bb82c5c7e90e98725d283d0889b.zip | |
Cast runnableEnv items to string
| -rw-r--r-- | editors/code/src/config.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index a9c0f079b3d..d66aa52fadc 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -133,7 +133,21 @@ export class Config { } get runnableEnv() { - return this.get<RunnableEnvCfg>("runnableEnv"); + const item = this.get<any>("runnableEnv"); + if (!item) return item; + const fixRecord = (r: Record<string, any>) => { + for (const key in r) { + if (typeof r[key] !== 'string') { + r[key] = String(r[key]); + } + } + }; + if (item instanceof Array) { + item.forEach((x) => fixRecord(x.env)); + } else { + fixRecord(item); + } + return item; } get restartServerOnConfigChange() { |
