blob: 238c08c17276f3f060c73353cd1a0cd71da60840 (
plain)
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
|
import path from 'path';
export function resolveBin(binaryName: string) {
return path.resolve(getBasePath(), binaryName + getExtension());
}
function getBasePath(): string {
if (process.env.NODE_ENV === 'development') {
return (
process.env.MULLVAD_PATH || path.resolve(path.join(__dirname, '../../../../target/debug'))
);
} else {
return process.resourcesPath!;
}
}
function getExtension() {
switch (process.platform) {
case 'win32':
return '.exe';
default:
return '';
}
}
|