Skip to content
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
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ var project = require('./server/project');
var exec = require('child_process').exec
var path = require('path')
var fs = require('fs')
var os = require('os');

var packageJSON = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf-8'))

var checkForDependencies = function(callback) {
exec('which npm', function(err, stdout, stderr) {
//Windows does not, by default, have the command which. The equivelant is where, thus, adding here.
var execCommand = ( os.type == "Windows NT" ) ? "where npm" : "which npm";
exec(execCommand, function(err, stdout, stderr) {
if (err) {
console.error('Could not find `npm` command. Is npm installed?')
process.exit(-1)
Expand Down
3 changes: 3 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var express = require('express');
var sockeio = require('socket.io')
var project = require('./project.js')
var child_process = require('child_process')
var os = require( 'os' )

var server = express.createServer();
var staticServer = express.createServer();
Expand Down Expand Up @@ -57,6 +58,8 @@ exports.listen = function(port, host, username, password, downgrade, launchBrows

server.listen(port, host, function() {
staticServer.listen(port+1, host, function() {
//ignore this work for windows Operating Systems
if (os.type != "Windows_NT" )
// if run as root, downgrade to the owner of this file
if (process.getuid() === 0) {
if(downgrade == true){
Expand Down