exec-pod-callback
v1.0.2
Published
Callback-style version of exec-pod
Downloads
13
Maintainers
Readme
exec-pod-callback
Callback-style version of exec-pod:
Run a
pod
subcommand and buffer the output
const execPodCallback = require('exec-pod-callback');
execPodCallback('search', ['AWS'], (err, stdout, stderr) => {
stdout; //=> '-> AWSAPIGateway (2.2.7)\n Amazon Web Services SDK for iOS ...'
});
Installation
npm install exec-pod-callback
and make sure cocoapods
is installed.
API
const execPodCallback = require('exec-pod-callback');
execPodCallback(subcommand [, args, options, cb])
subcommand: String
(one of the pod
subcommands to run e.g. install
)
args: Array
of strings (arguments passed to the command)
options: Object
cb: Function
(callback function which takes three arguments: error
, stdout
, stderr
)
Return: ChildProcess instance
It runs the given pod
subcommand and passes buffered stdout
/stderr
values to the callback function.
execPodCallback('install', ['AFNetworking'], {bundleExec: true}, (err, stdout, stderr) => {
if (err) {
throw err;
}
stdout; //=> 'Updating spec repo `master` ... '
});
Options
All child_process#execFile
options and bundleExec
option are available.
options.bundleExec
Type: Boolean
Default: false
true
runs the pod
command with bundle exec
, instead of using globally installed pod
.
Related project
- exec-pod (Promises/A+ version)
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.