Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Return a promise from API, and handle errors in CLI.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimBarham committed Oct 12, 2015
1 parent 4f5b143 commit fdd2d21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bin/simulate
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ var chalk = require('chalk');
var args;
try {
args = processArgs(process.argv);
require('./../src/simulate')({platform: args.platform, target: args.target});
require('./../src/simulate')({platform: args.platform, target: args.target}).catch(function (e) {
console.log(chalk.red.bold(e.toString()));
});
} catch (e) {
console.log(chalk.red.bold(e.stack));
console.log(chalk.red.bold(e.toString()));
}

function processArgs(args) {
Expand Down
2 changes: 1 addition & 1 deletion src/simulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function (opts) {
var target = opts.target || 'chrome';
var simHostUrl;

simulateServer(opts, {
return simulateServer(opts, {
simHostRoot: path.join(__dirname, 'sim-host'),
node_modules: path.resolve(__dirname, '..', 'node_modules')
}).then(function (urls) {
Expand Down

0 comments on commit fdd2d21

Please sign in to comment.