| 75 | } |
| 76 | |
| 77 | function createConfig(packageName) { |
| 78 | const homeDir = os.homedir() |
| 79 | const configDir = path.join(homeDir, '.config', 'manicode') |
| 80 | const binaryName = |
| 81 | process.platform === 'win32' ? `${packageName}.exe` : packageName |
| 82 | |
| 83 | return { |
| 84 | homeDir, |
| 85 | configDir, |
| 86 | binaryName, |
| 87 | binaryPath: path.join(configDir, binaryName), |
| 88 | metadataPath: path.join(configDir, 'freebuff-metadata.json'), |
| 89 | tempDownloadDir: path.join(configDir, '.freebuff-download-temp'), |
| 90 | userAgent: `${packageName}-cli`, |
| 91 | requestTimeout: 20000, |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | const CONFIG = createConfig(packageName) |
| 96 | const { getProxyUrl, httpGet } = createReleaseHttpClient({ |