exec-pod
v1.0.0
Published
Run a `pod` subcommand and buffer the output
Downloads
14
Maintainers
Readme
exec-pod
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 ...'
});
Installation
npm install exec-pod
and make sure CocoaPods
is installed.
API
const execPod = require('exec-pod');
execPod(subcommand [, args, options])
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` ... '
});
Options
All child_process#execFile
options and bundleExec
option (described below) 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-callback (Callback-style version)
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.