How to use the cordova-common.superspawn.spawn function in cordova-common

To help you get started, we’ve selected a few cordova-common 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 apache / cordova-ios / bin / templates / scripts / cordova / lib / Podfile.js View on Github external
.then(toolOptions => {
            if (toolOptions.ignore) {
                events.emit('verbose', '==== pod install start ====\n');
                events.emit('verbose', toolOptions.ignoreMessage);
                return Q.resolve();
            } else {
                return superspawn.spawn('pod', ['install', '--verbose'], opts)
                    .progress(stdio => {
                        if (stdio.stderr) { console.error(stdio.stderr); }
                        if (stdio.stdout) {
                            if (first) {
                                events.emit('verbose', '==== pod install start ====\n');
                                first = false;
                            }
                            events.emit('verbose', stdio.stdout);
                        }
                    });
            }
        })
        .then(() => { // done
github qualintitative / egoweb / app / node_modules / cordova-android / bin / templates / cordova / lib / emulator.js View on Github external
module.exports.list_images_using_avdmanager = function () {
    return superspawn.spawn('avdmanager', ['list', 'avd'])
    .then(function(output) {
        var response = output.split('\n');
        var emulator_list = [];
        for (var i = 1; i < response.length; i++) {
            // To return more detailed information use img_obj
            var img_obj = {};
            if (response[i].match(/Name:\s/)) {
                img_obj['name'] = response[i].split('Name: ')[1].replace('\r', '');
                if (response[i + 1].match(/Device:\s/)) {
                    i++;
                    img_obj['device'] = response[i].split('Device: ')[1].replace('\r', '');
                }
                if (response[i + 1].match(/Path:\s/)) {
                    i++;
                    img_obj['path'] = response[i].split('Path: ')[1].replace('\r', '');
                }
github katzer / cordova-plugin-badge / platforms / android / cordova / lib / check_reqs.js View on Github external
module.exports.check_ant = function () {
    return superspawn.spawn('ant', ['-version']).then(function (output) {
        // Parse Ant version from command output
        return /version ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
    }).catch(function (err) {
        if (err) {
            throw new CordovaError('Failed to run `ant -version`. Make sure you have `ant` on your $PATH.');
        }
    });
};
github sozialhelden / wheelmap-frontend / platforms / ios / cordova / lib / run.js View on Github external
function deployToDevice (appPath, target, extraArgs) {
    // Deploying to device...
    if (target) {
        return superspawn.spawn('ios-deploy', ['--justlaunch', '-d', '-b', appPath, '-i', target].concat(extraArgs), { printCommand: true, stdio: 'inherit' });
    } else {
        return superspawn.spawn('ios-deploy', ['--justlaunch', '--no-wifi', '-d', '-b', appPath].concat(extraArgs), { printCommand: true, stdio: 'inherit' });
    }
}
github katzer / cordova-plugin-badge / platforms / ios / cordova / lib / run.js View on Github external
function iossimLaunch (appPath, devicetypeid, log, exit) {
    var f = path.resolve(path.dirname(require.resolve('ios-sim')), 'bin', 'ios-sim');
    var params = ['launch', appPath, '--devicetypeid', devicetypeid, '--log', log, exit];

    return superspawn.spawn(f, params, { cwd: projectPath, printCommand: true })
        .progress(function (stdio) {
            if (stdio.stderr) {
                events.emit('error', `[ios-sim] ${stdio.stderr}`);
            }
            if (stdio.stdout) {
                events.emit('log', `[ios-sim] ${stdio.stdout.trim()}`);
            }
        })
        .then(function (result) {
            events.emit('log', 'Simulator successfully started via `ios-sim`.');
        });
}
github apache / cordova-lib / src / platforms / PlatformApiPoly.js View on Github external
PlatformApiPoly.updatePlatform = function (destinationDir, options) {
    if (!options || !options.platformDetails) {
        return Q.reject(new CordovaError('Failed to find platform\'s \'create\' script. ' +
            'Either \'options\' parameter or \'platformDetails\' option is missing'));
    }

    var command = path.join(options.platformDetails.libDir, 'bin', 'update');
    return superspawn.spawn(command, [destinationDir],
        { printCommand: true, stdio: 'inherit', chmod: true })
        .then(function () {
            var platformApi = knownPlatforms
                .getPlatformApi(options.platformDetails.platform, destinationDir);
            copyCordovaSrc(options.platformDetails.libDir, platformApi.getPlatformInfo());
            return platformApi;
        });
};
github apache / cordova-android / spec / e2e / plugin.spec.js View on Github external
            .then(() => superspawn.spawn(createBin, [projectPath, projectid, projectname]))
            .then(() => {
github alex-shpak / keemob / platforms / android / cordova / lib / android_sdk.js View on Github external
module.exports.list_targets_with_android = function () {
    return superspawn.spawn('android', ['list', 'target']).then(parse_targets);
};
github alex-shpak / keemob / platforms / android / cordova / lib / android_sdk.js View on Github external
module.exports.list_targets_with_avdmanager = function () {
    return superspawn.spawn('avdmanager', ['list', 'target']).then(parse_targets);
};
github apache / cordova-lib / cordova-lib / src / platforms / PlatformApiPoly.js View on Github external
PlatformApiPoly.createPlatform = function (destinationDir, projectConfig, options) {
    if (!options || !options.platformDetails)
        return Q.reject(new CordovaError('Failed to find platform\'s \'create\' script. ' +
            'Either \'options\' parameter or \'platformDetails\' option is missing'));

    var command = path.join(options.platformDetails.libDir, 'bin', 'create');
    var commandArguments = getCreateArgs(destinationDir, projectConfig, options);

    return superspawn.spawn(command, commandArguments,
        { printCommand: true, stdio: 'inherit', chmod: true })
    .then(function () {
        var platformApi = knownPlatforms
            .getPlatformApi(options.platformDetails.platform, destinationDir);
        copyCordovaSrc(options.platformDetails.libDir, platformApi.getPlatformInfo());
        return platformApi;
    });
};