'use strict' /** * platform.js — OS detector and platform adapter loader * * Returns the platform-specific adapter for the current OS. * Each adapter exposes an identical interface so main.js can call * platform.xxx() without any process.platform conditionals. * * Interface exported by every adapter: * PLATFORM — string: 'win32' | 'linux' | 'darwin' * getWritableCandidates(name) — writable userData path candidates * normalizeExecName(cmd) — add .cmd on Windows, no-op elsewhere * shouldUseShell(cmd) — true only for .bat/.cmd on Windows * buildShellSpawn(cmd, args) — { file, args } for shell-wrapped spawn * getPtySpawnOptions() — extra options for node-pty.spawn() * resolveNodeRuntime() — absolute path / name of node executable * rewriteLinuxBuildCommand(cwd) — { cmd, args, rewriteInfo } * getProtectedPathBases() — OS-specific protected directory list */ const p = process.platform if (p === 'win32') module.exports = require('./platform-win32') else if (p === 'darwin') module.exports = require('./platform-darwin') else module.exports = require('./platform-linux')