Skip to content

Commit

Permalink
ENYO-2605: Correct jshint errors in root folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcDominjon committed Aug 8, 2013
1 parent f63074f commit c0ebdf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion chrome-app.js
@@ -1,4 +1,5 @@
g/**
/* global chrome, console */
/**
* Ares Chrome Packaged Application Background Page
*
* ares/ares-chrome-background.js
Expand Down
19 changes: 12 additions & 7 deletions ide.js
@@ -1,5 +1,5 @@
#!/usr/bin/env node

/* global require, __dirname, console, process */
/**
* ARES IDE server
*/
Expand Down Expand Up @@ -121,7 +121,6 @@ process.on('SIGINT', onExit);
// Load IDE configuration & start per-project file servers

var ide = {};
var service = {};
var subProcesses = [];
var platformVars = [
{regex: /@NODE@/, value: process.argv[0]},
Expand Down Expand Up @@ -372,9 +371,7 @@ function substVars(data, vars) {
var pType = getObjectType(data[key]);
if (pType === 'string') {
s = data[key];
vars.forEach(function(subst){
s = s.replace(subst.regex,subst.value);
});
s = substitute(s, vars);
data[key] = s;
} else if (pType === 'array') {
substVars(data[key], vars);
Expand All @@ -386,6 +383,13 @@ function substVars(data, vars) {
}
}

function substitute(s, vars) {
vars.forEach(function(subst){
s = s.replace(subst.regex,subst.value);
});
return s;
}

function startService(service) {
// substitute platform variables
substVars(service, platformVars);
Expand Down Expand Up @@ -620,13 +624,14 @@ if (argv.runtest) {
server.listen(argv.port, argv.listen_all ? null : argv.host, null /*backlog*/, function () {
var tcpAddr = server.address();
var url = "http://" + (argv.host || "127.0.0.1") + ":" + tcpAddr.port + "/ide/ares/" + page;
var info;
if (argv.browser) {
// Open default browser
var info = platformOpen[process.platform] ;
info = platformOpen[process.platform] ;
spawn(info[0], info.slice(1).concat([url]));
} else if (argv['bundled-browser']) {
// Open bundled browser
var info = platformOpen[process.platform].concat(bundledBrowser[process.platform]);
info = platformOpen[process.platform].concat(bundledBrowser[process.platform]);
spawn(info[0], info.slice(1).concat([url]));
} else {
log.http('main', "Ares now running at <" + url + ">");
Expand Down

0 comments on commit c0ebdf1

Please sign in to comment.