Skip to content

Commit

Permalink
Call checkForPrerequesites
Browse files Browse the repository at this point in the history
Note: I only call this if --app-mode is on. That's not actually correct
in that even if you run happyfuntimes without using --app-mode
it still needs the prerequisites. I guess my thinking was
currently they are only needed on linux and only if you install
something from superhappyfuntimes.

hmmm. maybe it should ways check?
  • Loading branch information
greggman committed May 1, 2015
1 parent acb2be4 commit 6b74015
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ function exitBecauseAlreadyRunning() {
console.error("HappyFunTimes is already running");
}

function checkForPrerequisites() {
var platInfo = require('../lib/platform-info');
return platInfo.checkForPrerequisites();
}

function startServer() {
if (args.appMode) {
require('../lib/games').init();
Expand Down Expand Up @@ -131,7 +136,14 @@ function startServer() {
var p;
if (args.appMode || args.show) {
var name = args.show || 'games';
p = browser.launch('http://localhost:' + server.getSettings().port + '/' + name + '.html', config.getConfig().preferredBrowser);
p = checkForPrerequisites()
.catch(function(err) {
console.error(err);
process.exit(1); // eslint-disable-line
})
.then(function() {
return browser.launch('http://localhost:' + server.getSettings().port + '/' + name + '.html', config.getConfig().preferredBrowser);
});
} else {
p = Promise.resolve();
}
Expand Down

0 comments on commit 6b74015

Please sign in to comment.