added check for CocoaPods >=0.36.4

This commit is contained in:
Dan Motzenbecker 2015-08-30 22:02:21 -04:00
parent 3c7d5463de
commit 522d854f71
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,7 @@ fs = require 'fs'
crypto = require 'crypto'
{execSync} = require 'child_process'
chalk = require 'chalk'
semver = require 'semver'
reactInit = require 'react-native/local-cli/init'
rnVersion = require(__dirname + '/package.json').dependencies['react-native']
@ -44,6 +45,10 @@ init = (projName) ->
execSync 'type lein'
execSync 'type pod'
podVersion = execSync('pod --version').toString().trim()
unless semver.satisfies podVersion, '>=0.36.4'
throw new Error "Natal requires CocoaPods 0.36.4 or higher (you have #{ podVersion }).
\nRun [sudo] gem update cocoapods and try again."
log 'Creating Leiningen project'
execSync "lein new #{ projNameHyph }"