Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2201 from mrfelton/fix/app-root-path
Browse files Browse the repository at this point in the history
refactor: fix appRootPath to run in main or preload process
  • Loading branch information
mrfelton committed May 16, 2019
2 parents ed8bda5 + 0e66fa6 commit 3f9ba3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/appRootPath.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { normalize } from 'path'
import { remote } from 'electron'
import electron, { remote } from 'electron'

const app = electron.app || remote.app

/**
* Get a path to prepend to any nodejs calls that are getting at files in the package,
Expand All @@ -15,9 +17,7 @@ import { remote } from 'electron'
* @return {String} Path to the lnd binary.
*/
const appRootPath = () => {
return remote.app.getAppPath().indexOf('default_app.asar') < 0
? normalize(`${remote.app.getAppPath()}/..`)
: ''
return app.getAppPath().indexOf('default_app.asar') < 0 ? normalize(`${app.getAppPath()}/..`) : ''
}

export default appRootPath

0 comments on commit 3f9ba3d

Please sign in to comment.