{"record":{"id":"ed653297a1a34900","repo":"docmirror/dev-sidecar","slug":"error-ed6532","errorCode":null,"errorMessage":"暂未实现此功能","messagePattern":"暂未实现此功能","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/shell/scripts/get-system-env.js","lineNumber":24,"sourceCode":"const execute = Shell.execute\n\nconst executor = {\n  async windows (exec) {\n    const ret = await exec(['set'], { type: 'cmd' })\n    const map = {}\n    if (ret != null) {\n      const lines = ret.split('\\r\\n')\n      for (const item of lines) {\n        const kv = item.split('=')\n        if (kv.length > 1) {\n          map[kv[0].trim()] = kv[1].trim()\n        }\n      }\n    }\n    return map\n  },\n  async linux (exec, { port }) {\n    throw new Error('暂未实现此功能')\n  },\n  async mac (exec, { port }) {\n    throw new Error('暂未实现此功能')\n  },\n}\n\nmodule.exports = async function (args) {\n  return execute(executor, args)\n}\n","sourceCodeStart":6,"sourceCodeEnd":34,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/core/src/shell/scripts/get-system-env.js#L6-L34","documentation":"`get-system-env` reads OS environment/registry-like settings; only the Windows implementation exists. On Linux the handler throws `暂未实现此功能` as an explicit not-implemented marker.","triggerScenarios":"Calling the get-system-env shell API on Linux so execution dispatches to the placeholder `linux` handler in packages/core/src/shell/scripts/get-system-env.js:24.","commonSituations":"Settings/system pages of the GUI run on Linux; cross-platform scripts collecting system environment through this helper.","solutions":["Read environment values directly from `process.env` or shell (`printenv`, `env`) on Linux.","Implement the linux handler to return a map built from `process.env`.","Only call this helper on Windows; branch by platform."],"exampleFix":"// before\nconst map = await DevSidecar.shell.getSystemEnv({ port })\n// after\nconst map = process.platform === 'win32'\n  ? await DevSidecar.shell.getSystemEnv({ port })\n  : process.env","handlingStrategy":"fallback","validationCode":"if (process.platform === 'win32') {\n  const map = await DevSidecar.shell.getSystemEnv({ port })\n} else {\n  const map = process.env\n}","typeGuard":"function supportsSystemEnvHelper () {\n  return process.platform === 'win32'\n}","tryCatchPattern":"try {\n  map = await DevSidecar.shell.getSystemEnv({ port })\n} catch (err) {\n  if (err.message === '暂未实现此功能') {\n    map = process.env\n  } else { throw err }\n}","preventionTips":["Prefer process.env for environment reads on Linux","Only invoke get-system-env on Windows","Wrap shell helpers in a platform-aware facade in your app"],"tags":["platform-unsupported","linux","environment","not-implemented"],"backgroundTag":"feature-not-implemented","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}