mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 08:03:37 +00:00
18 lines
449 B
TypeScript
18 lines
449 B
TypeScript
export function addWslEnvKeys(
|
|
env: Record<string, string | undefined>,
|
|
keys: readonly string[]
|
|
): void {
|
|
const existing = env.WSLENV ?? process.env.WSLENV ?? ''
|
|
const tokens = existing.split(':').filter(Boolean)
|
|
const tokenNames = new Set(tokens.map((token) => token.split('/')[0]))
|
|
|
|
for (const key of keys) {
|
|
if (!tokenNames.has(key)) {
|
|
tokens.push(key)
|
|
tokenNames.add(key)
|
|
}
|
|
}
|
|
|
|
env.WSLENV = tokens.join(':')
|
|
}
|