How to use the simple-plist.Fabric function in simple-plist

To help you get started, we’ve selected a few simple-plist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hypery2k / nativescript-fabric / src / lib / after-prepare.js View on Github external
var appName = path.basename($projectData.projectDir);
                    var sanitizedName = appName.split('').filter(function(c) { return /[a-zA-Z0-9]/.test(c); }).join('');
                    var projectPath = path.join($projectData.projectDir, 'platforms', 'ios', sanitizedName + '.xcodeproj', 'project.pbxproj');
                    var plistPath = path.join($projectData.projectDir, 'platforms', 'ios', sanitizedName, sanitizedName + '-Info.plist');
                    var podsPath = path.join($projectData.projectDir, 'platforms', 'ios', 'Pods');
                    $logger.trace('Using Xcode project', projectPath);
                    $logger.trace('Using Info plist', plistPath);
                    $logger.trace('Using Pods path', podsPath);
                    var xcodeProject = xcode.project(projectPath);
                    xcodeProject.parseSync();
                    var options = { shellPath: '/bin/sh', shellScript: podsPath + '/Fabric/run ' + apiKey + ' ' + apiSecret };
                    var buildPhase = xcodeProject.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Configure Fabric', xcodeProject.getFirstTarget().uuid, options).buildPhase;
                    $logger.trace('Written Xcode project');
                    fs.writeFileSync(projectPath, xcodeProject.writeSync());
                    var appPlist = plist.readFileSync(plistPath);
                    plist.Fabric = {
                        APIKey: apiKey,
                        Kits: [{
                            KitInfo: '',
                            KiteName: 'Crashlytics'
                        }, {
                            KitInfo: '',
                            KiteName: 'Answers'
                        }]
                    }
                    plist.writeFileSync(plistPath, appPlist);
                    $logger.trace('Written Info plist');
                    resolve();
                } else if (platform == 'windows') {
                    //TODO PRs gladly accepted :P
                    reject();
                }

simple-plist

A wrapper utility for interacting with plist data.

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis