Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added start script to help debugging #346

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"grunt-contrib-sass": "~0.7.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-compass": "~0.7.1"
},
"scripts": {
"start": "node start.js"
}
}
37 changes: 37 additions & 0 deletions start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var path = require('path');
var child_process = require('child_process');

var exeNames = {
windows: 'nw.exe',
linux: 'nw',
mac: ''
};
var osName = getOperatingSystem();
if(osName == 'windows' || osName == 'linux') {
var exePath = path.join(__dirname, 'node-webkit', osName, exeNames[osName]);
var child = child_process.spawn(exePath, [__dirname, '--debug'], {
cwd: __dirname,
detached: true,
stdio: 'ignore'
});
child.unref();
}
// Mac not supported yet. I don't know how to start a .app directory.
// If someone else does, feel free to add it


function getOperatingSystem() {
var os = require('os');
var platform = os.platform();

if( platform == 'win32' || platform == 'win64' ) {
return 'windows';
}
if( platform == 'darwin' ) {
return 'mac';
}
if( platform == 'linux' ) {
return 'linux';
}
return null;
}