File size: 1,225 Bytes
b92316a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'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')