paths.js 684 B
Newer Older
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
Amaury Martiny's avatar
Amaury Martiny committed
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause

/* global __static */

import path from 'path';

Amaury Martiny's avatar
Amaury Martiny committed
const appIsPackaged = !process.defaultApp;
Amaury Martiny's avatar
Amaury Martiny committed

/**
 * Get the path to the `static` folder.
 *
 * @see https://github.com/electron-userland/electron-webpack/issues/52
 */
Amaury Martiny's avatar
Amaury Martiny committed
const staticPath = appIsPackaged
Amaury Martiny's avatar
Amaury Martiny committed
  ? __dirname.replace(/app\.asar$/, 'static')
  : __static;
Amaury Martiny's avatar
Amaury Martiny committed

/**
 * Get the path to the bundled Parity Ethereum binary.
 */
const bundledParityPath =
  process.platform === 'win32'
    ? path.join(staticPath, 'parity.exe')
    : path.join(staticPath, 'parity');

export { staticPath, bundledParityPath };