Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

afterPrepareHook function "parseOptionsFromConsole" throwing a typeerror #48

Closed
dannypritchard opened this issue Nov 27, 2015 · 3 comments
Labels
Milestone

Comments

@dannypritchard
Copy link

In afterPrrepareHook.js, the function parseOptionsFromConsole throws a typeerror on line 60 when I type in terminal
cordova run ios --device

This is preventing the deploy script from deploying the app to the ios device I have attached via USB.

If I console.log consoleOptions before the for loop begins, the contents of this object is:
{ device: true, argv: [] }

By the looks of it, the indexOf check is expecting a string, but is getting a boolean.

As a workaround I've put a typeof opt === 'string' check into the if statement on line 60, but I think something fishy is going on here.

@nikDemyankov nikDemyankov added this to the v1.1.2 milestone Nov 27, 2015
@nikDemyankov
Copy link
Member

Thanks, found the problem.

@nikDemyankov
Copy link
Member

This is because of the new version of Cordova. On the previous version (at least, 5.3.3) it returned options as array of strings: [--release]. Now (v5.4.1) console arguments are an object: { device: true, argv: [] }.

@nikDemyankov
Copy link
Member

Fixed in master branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants