Skip to content

Commit

Permalink
Use process.resourcesPath instead of process.cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed May 17, 2015
1 parent 4cd11be commit ee03191
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
.DS_Store
node_modules
node_modules
*.app
6 changes: 3 additions & 3 deletions example/package.json
Expand Up @@ -3,11 +3,11 @@
"version": "1.0.0",
"description": "example menubar electron app",
"dependencies": {
"menubar": "*",
"electron-prebuilt": "0.26.0"
"menubar": "*"
},
"devDependencies": {
"electron-packager": "^4.0.2"
"electron-packager": "^4.0.2",
"electron-prebuilt": "0.26.0"
},
"main": "main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -9,9 +9,9 @@ var BrowserWindow = require('browser-window')
var extend = require('extend')

module.exports = function create (opts) {
if (typeof opts === 'undefined') opts = {dir: process.cwd()}
if (typeof opts === 'undefined') opts = {dir: process.resourcesPath}
if (typeof opts === 'string') opts = {dir: opts}
if (!opts.dir) opts.dir = process.cwd()
if (!opts.dir) opts.dir = process.resourcesPath
if (!(path.isAbsolute(opts.dir))) opts.dir = path.resolve(opts.dir)
if (!opts.index) opts.index = 'file://' + path.join(opts.dir, 'index.html')

Expand Down

0 comments on commit ee03191

Please sign in to comment.