Files
5chan/electron/kubo-paths.js
T
Tommaso CasaburiandGitHub a67c66de0d perf(electron): speed up Windows packaging with ASAR (#1190)
* perf(electron): package Windows app with ASAR

* fix(electron): use portable ASAR unpack glob

* fix(electron): unpack native modules from ASAR
2026-08-01 12:50:23 +02:00

17 lines
696 B
JavaScript

import path from 'node:path';
export const getIpfsBinaryName = (platform = process.platform) => (platform === 'win32' ? 'ipfs.exe' : 'ipfs');
const getPlatformDirectory = (platform) => {
if (platform === 'win32') return 'win';
if (platform === 'darwin') return 'mac';
return 'linux';
};
export const getBundledKuboPath = (rootPath, platform = process.platform) => path.join(rootPath, 'bin', getPlatformDirectory(platform), getIpfsBinaryName(platform));
export const getPackagedKuboPaths = (resourcesPath, platform = process.platform) => [
getBundledKuboPath(path.join(resourcesPath, 'app.asar.unpacked'), platform),
getBundledKuboPath(path.join(resourcesPath, 'app'), platform),
];