Use plist.parse instead of plist.parseFileSync.

When running Appium, I got a warning / error stating that:

    `parseFileSync()` is deprecated. Use `parseStringSync()` instead.

and my task was halted.

Appium uses `"plist": "~1.0.0"` in `package.json`.

`plist` v1.0.0 and up says that `parseFileSync()` is deprecated, and
that it should be replaced with `parseStringSync()`.  However,
`parseStringSync()` is *also* deprecated, to be replaced with `parse()`.
This all is based on:

 - https://github.com/TooTallNate/plist.js/blob/v1.0.0/lib/node.js#L15
 - https://github.com/TooTallNate/plist.js/blob/v1.0.0/lib/parse.js#L16

So I changed the related line in the iOS configuration file to point to
the new method `parse()`. This appears to resolve this error and allows
me to continue.
This commit is contained in:
Anthony Panozzo
2014-11-26 17:43:46 -05:00
parent fa78861817
commit 17b274ff2e

View File

@@ -33,7 +33,7 @@ var path = require('path')
// XML Plist library helper
var parseXmlPlistFile = function (plist, cb) {
try {
var result = xmlplist.parseFileSync(plist);
var result = xmlplist.parse(plist);
return cb(null, result);
} catch (ex) {
return cb(ex);