( env: CliEnv = getCliEnv(), )
| 234 | } |
| 235 | |
| 236 | const resolveJetBrainsLafPaths = ( |
| 237 | env: CliEnv = getCliEnv(), |
| 238 | ): string[] => { |
| 239 | const candidates: string[] = [] |
| 240 | |
| 241 | // Check IDE config dirs |
| 242 | if (env.IDE_CONFIG_DIR) { |
| 243 | candidates.push(join(env.IDE_CONFIG_DIR, 'options', 'laf.xml')) |
| 244 | } |
| 245 | if (env.JB_IDE_CONFIG_DIR) { |
| 246 | candidates.push(join(env.JB_IDE_CONFIG_DIR, 'options', 'laf.xml')) |
| 247 | } |
| 248 | |
| 249 | const home = homedir() |
| 250 | |
| 251 | const baseDirs: string[] = [] |
| 252 | if (process.platform === 'darwin') { |
| 253 | baseDirs.push(join(home, 'Library', 'Application Support', 'JetBrains')) |
| 254 | } else if (process.platform === 'win32') { |
| 255 | const appData = env.APPDATA |
| 256 | if (appData) { |
| 257 | baseDirs.push(join(appData, 'JetBrains')) |
| 258 | } |
| 259 | } else { |
| 260 | baseDirs.push(join(home, '.config', 'JetBrains')) |
| 261 | baseDirs.push(join(home, '.local', 'share', 'JetBrains')) |
| 262 | } |
| 263 | |
| 264 | for (const base of baseDirs) { |
| 265 | try { |
| 266 | if (!existsSync(base)) continue |
| 267 | const entries = readdirSync(base) |
| 268 | for (const entry of entries) { |
| 269 | const dirPath = join(base, entry) |
| 270 | try { |
| 271 | if (!statSync(dirPath).isDirectory()) continue |
| 272 | } catch { |
| 273 | continue |
| 274 | } |
| 275 | |
| 276 | candidates.push(join(dirPath, 'options', 'laf.xml')) |
| 277 | } |
| 278 | } catch { |
| 279 | // Ignore unreadable directories |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | return candidates |
| 284 | } |
| 285 | |
| 286 | const resolveZedSettingsPaths = ( |
| 287 | env: CliEnv = getCliEnv(), |
no test coverage detected