ios.installPlugin(config, plugin, function (err) {
        var plistPath = config.projectPath + '/SampleApp/PhoneGap.plist';
        plist.parseFile(plistPath, function (err, obj) {

            test.equal(obj.Plugins['com.phonegap.plugins.childbrowser'],
                'ChildBrowserCommand');
                
            test.equal(obj.ExternalHosts.length, 2)    
            test.equal(obj.ExternalHosts[0], "build.phonegap.com")
            test.equal(obj.ExternalHosts[1], "s3.amazonaws.com")

            test.done();
        });
    })
Beispiel #2
0
        glob(config.projectPath + '/**/{PhoneGap,Cordova}.plist', function (err, files) {
            if (!files.length) throw "does not appear to be a PhoneGap project";

            files = files.filter(function (val) {
                return !(/^build\//.test(val))
            });

            store.plistPath = files[0];
            store.pluginsDir = path.resolve(files[0], '..', 'Plugins');

            plist.parseFile(store.plistPath, function (err, obj) {
                store.plist = obj;
                end();
            });
        });
    /**
     * Read iTunes Library XML file (PLIST);
     *
     * @param method callback
     * @return void
     */
    function readItunesLibraryXML(callback) {

        try {


            plist.parseFile(musicFolder + "/iTunes/iTunes Music Library.xml", function (error, data) {

                if (!error) {
                    /*
                    Major Version
                    Minor Version
                    Date
                    Application Version
                    Features
                    Show Content Ratings
                    Music Folder
                    Library Persistent ID
                    Tracks
                    Playlists
                     */

                    library = data[0];

                    if (callback) {
                        callback();
                    }
                } else {
                    console.log('Could not parse the iTunes Music Library', error);
                }

            });
        } catch (exception) {
            console.log('Could not read the iTunes Music Library', exception);
        }

    }
Beispiel #4
0
 getPath(function(err, p) {
     var pl = path.join(p, 'Contents', 'Info.plist');
     plist.parseFile(pl, function(err, data) {
         callback(err, data[0].KSVersion);
     });
 });
 function(callback){
   plist.parseFile(path, function(err, obj) {
     if (err) { callback(err); }
     callback(null, obj);
   });
 },
Beispiel #6
0
// DEPRECATED - plist removed from package.json dependancies
var plist = require('plist'),
    path = require('path')
    fs = require('fs');

var infile = 'observationdata.xml';
var outfile = 'observationdata.json';
plist.parseFile(infile, function(err, plist) {
  if (err) throw err;
  var obs = plist[0];

  console.log('found '+obs.length+' observations');
  console.log('  '+obs[obs.length-1].stamp+' ... '+obs[0].stamp);

  var jsonPretty = JSON.stringify(obs,null,2);
  
  fs.writeFileSync(path.join(__dirname, outfile), jsonPretty,'utf8');

});

Beispiel #7
0
 getPath(function(err, p) {
     var pl = path.join(p, '../../', 'Info.plist');
     plist.parseFile(pl, function(err, data) {
         callback(err, data[0].CFBundleGetInfoString);
     });
 });
 getPath(function(err, p) {
     var pl = path.join(p, 'Contents', 'version.plist');
     plist.parseFile(pl, function(err, data) {
         callback(err, data[0].CFBundleShortVersionString);
     });
 });