Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ios-sim",
"version": "5.1.0",
"version": "6.0.0",
"preferGlobal": "true",
"description": "launch iOS apps into the iOS Simulator from the command line (Xcode 7.0+)",
"main": "ios-sim.js",
Expand Down
6 changes: 4 additions & 2 deletions spec/lib.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ describe('lib end-to-end', function() {
});
})

// it('', function(done) {
// });
it('init should not process.exit when called as a lib', function() {
var code = lib.init();
expect(!isNaN(code)).toBe(true);
});
});
5 changes: 4 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ var nopt;
function init() {
try {
nopt = require('nopt');
command_lib.init();
var code = command_lib.init();
if (code !== 0) {
process.exit(code);
}
} catch (e) {
console.error(
'Please run npm install from this directory:\n\t' +
Expand Down
2 changes: 1 addition & 1 deletion src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var path = require('path'),
var command_lib = {

init: function() {
lib.init();
return lib.init();
},

//jscs:disable disallowUnusedParams
Expand Down
3 changes: 2 additions & 1 deletion src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,13 @@ var lib = {
var output = simctl.check_prerequisites();
if (output.code !== 0) {
console.error(output.output);
process.exit(2);
}

if (!bplist) {
bplist = require('bplist-parser');
}

return output.code;
},

//jscs:disable disallowUnusedParams
Expand Down