Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
242d3a3d
Commit
242d3a3d
authored
Jan 24, 2015
by
Xavi Matos
Committed by
Xavi Matos
Feb 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented Xcode license check for all Commands
parent
a286e377
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
command.rb
lib/cocoapods/command.rb
+20
-0
No files found.
CHANGELOG.md
View file @
242d3a3d
...
@@ -134,6 +134,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -134,6 +134,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
##### Enhancements
*
Check for Xcode License Agreement before running commands.
[
Xavi Matos
](
https://github.com/CalQL8ed-K-OS
)
[
#3002
](
https://github.com/CocoaPods/CocoaPods/issues/3002
)
*
Do not generate targets for Pods without sources.
*
Do not generate targets for Pods without sources.
[
Boris Bügling
](
https://github.com/neonichu
)
[
Boris Bügling
](
https://github.com/neonichu
)
[
#2918
](
https://github.com/CocoaPods/CocoaPods/issues/2918
)
[
#2918
](
https://github.com/CocoaPods/CocoaPods/issues/2918
)
...
...
lib/cocoapods/command.rb
View file @
242d3a3d
...
@@ -41,6 +41,7 @@ module Pod
...
@@ -41,6 +41,7 @@ module Pod
def
self
.
run
(
argv
)
def
self
.
run
(
argv
)
help!
'You cannot run CocoaPods as root.'
if
Process
.
uid
==
0
help!
'You cannot run CocoaPods as root.'
if
Process
.
uid
==
0
verify_xcode_license_approved!
super
(
argv
)
super
(
argv
)
UI
.
print_warnings
UI
.
print_warnings
...
@@ -121,5 +122,24 @@ module Pod
...
@@ -121,5 +122,24 @@ module Pod
raise
Informative
,
"No `Podfile.lock' found in the project directory, run `pod install'."
raise
Informative
,
"No `Podfile.lock' found in the project directory, run `pod install'."
end
end
end
end
def
self
.
verify_xcode_license_approved!
unless
xcode_license_approved?
raise
Informative
,
xcode_license_message
end
end
def
self
.
xcode_license_approved?
!
(
`/usr/bin/xcrun clang 2>&1`
=~
/license/
&&
!
$?
.
success?
)
end
def
self
.
xcode_license_message
<<-
EOS
.
strip_heredoc
You have not agreed to the Xcode license.
The setup command requires you do so.
Agree to the license by running:
`xcodebuild -license`
EOS
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment