diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-11-02 10:51:12 +0100 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-11-09 12:42:56 +0100 |
| commit | ae8e86bb81cc722d9667c439d3508660398da707 (patch) | |
| tree | 05a467e918755c290194df119d5977862d1e6f4b /app/lib | |
| parent | 01d617bab821f25412f4874354468afea30bd7b9 (diff) | |
| download | mullvadvpn-ae8e86bb81cc722d9667c439d3508660398da707.tar.xz mullvadvpn-ae8e86bb81cc722d9667c439d3508660398da707.zip | |
Problem report
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/ipc-facade.js | 8 | ||||
| -rw-r--r-- | app/lib/proc.js | 27 |
2 files changed, 31 insertions, 4 deletions
diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js index 7a71861ae5..5b67dcb76f 100644 --- a/app/lib/ipc-facade.js +++ b/app/lib/ipc-facade.js @@ -210,12 +210,12 @@ export class RealIpc implements IpcFacade { }); } + setCloseConnectionHandler(handler: () => void) { + this._ipc.setCloseConnectionHandler(handler); + } + authenticate(sharedSecret: string): Promise<void> { return this._ipc.send('auth', sharedSecret) .then(this._ignoreResponse); } - - setCloseConnectionHandler(handler: () => void) { - this._ipc.setCloseConnectionHandler(handler); - } } diff --git a/app/lib/proc.js b/app/lib/proc.js new file mode 100644 index 0000000000..d11fa392a5 --- /dev/null +++ b/app/lib/proc.js @@ -0,0 +1,27 @@ +// @flow + +import path from 'path'; + +export function resolveBin(binaryName: string) { + const basepath = getBasePath(); + return path.resolve(basepath, binaryName + getExtension()); +} + +function getBasePath() { + if (process.env.NODE_ENV === 'development') { + return process.env.MULLVAD_BACKEND || '../talpid_core/target/debug'; + + } else { + return process.resourcesPath; + } +} + +function getExtension() { + switch (process.platform) { + case 'win32': + return '.exe'; + + default: + return ''; + } +} |
