Run a pod
subcommand and buffer the output like child_process#execFile
does
const execPod = require('exec-pod');
execPod('search', ['AWS']).then(output => {
output; //=> '-> AWSAPIGateway (2.2.7)\n Amazon Web Services SDK for iOS ...'
});
npm install exec-pod
and make sure CocoaPods
is installed.
const execPod = require('exec-pod');
subcommand: String
(one of the pod
subcommands to run, e.g. install
)
args: Array
of strings (arguments passed to the command)
options: Object
Return: Promise instance
It runs the given pod
subcommand and returns a Promise
instance.
When the command finishes successfilly, it will be fulfilled with the command output.
When it fails to run the command or the command itself fails, it will be rejected with an error.
execPod('install', ['AFNetworking'], {bundleExec: true}).then(output => {
output; //=> 'Updating spec repo `master` ... '
});
All child_process#execFile
options and bundleExec
option (described below) are available.
Type: Boolean
Default: false
true
runs the pod
command with bundle exec
, instead of using globally installed pod
.
- exec-pod-callback (Callback-style version)
Copyright (c) 2015 - 2016 Shinnosuke Watanabe
Licensed under the MIT License.