(
filePath: string,
contents: { posix: string; win32: string }
)
| 42 | } |
| 43 | |
| 44 | function writeExecutable( |
| 45 | filePath: string, |
| 46 | contents: { posix: string; win32: string } |
| 47 | ) { |
| 48 | mkdirSync(path.dirname(filePath), { recursive: true }); |
| 49 | writeFileSync( |
| 50 | filePath, |
| 51 | process.platform === 'win32' ? contents.win32 : contents.posix |
| 52 | ); |
| 53 | |
| 54 | if (process.platform !== 'win32') { |
| 55 | chmodSync(filePath, 0o755); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | function getVercelBinName(): string { |
| 60 | return process.platform === 'win32' ? 'vercel.cmd' : 'vercel'; |