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
11124e93
Commit
11124e93
authored
Jul 23, 2013
by
Chris McKnight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add licenses command to pod cli
parent
739f4f4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
command.rb
lib/cocoapods/command.rb
+1
-0
licenses.rb
lib/cocoapods/command/licenses.rb
+47
-0
No files found.
lib/cocoapods/command.rb
View file @
11124e93
...
...
@@ -11,6 +11,7 @@ module Pod
require
'cocoapods/command/help'
require
'cocoapods/command/inter_process_communication'
require
'cocoapods/command/lib'
require
'cocoapods/command/licenses'
require
'cocoapods/command/list'
require
'cocoapods/command/outdated'
require
'cocoapods/command/podfile_info'
...
...
lib/cocoapods/command/licenses.rb
0 → 100644
View file @
11124e93
module
Pod
class
Command
class
Licenses
<
Command
self
.
summary
=
'Show licenses of installed pods'
self
.
description
=
<<-
DESC
Shows the licenses of installed pods
DESC
def
initialize
(
argv
)
super
end
def
run
verify_podfile_exists!
verify_lockfile_exists!
lockfile
=
config
.
lockfile
pods
=
lockfile
.
pod_names
licenses
=
[]
deps
=
lockfile
.
dependencies
.
map
{
|
d
|
d
.
name
}
pods
=
(
deps
+
pods
).
uniq
pods
.
each
do
|
pod_name
|
spec
=
(
Pod
::
SourcesManager
.
search_by_name
(
pod_name
).
first
rescue
nil
)
license
=
"Unknown"
if
spec
specification
=
spec
.
specification
license
=
specification
.
license
[
:type
]
||
"Unknown"
end
licenses
<<
[
pod_name
,
license
]
end
if
licenses
.
empty?
UI
.
puts
"No pods found."
.
yellow
else
UI
.
section
"Licenses:"
do
licenses
.
each
do
|
(
name
,
license
)
|
UI
.
puts
"
#{
name
}
:
#{
license
}
"
end
end
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