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
7349d6b7
Commit
7349d6b7
authored
Mar 23, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #186 from CocoaPods/hidden-setup
Hidden setup
parents
838ae0b5
4ea808d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
command.rb
lib/cocoapods/command.rb
+11
-8
setup.rb
lib/cocoapods/command/setup.rb
+15
-4
No files found.
lib/cocoapods/command.rb
View file @
7349d6b7
...
@@ -51,15 +51,18 @@ module Pod
...
@@ -51,15 +51,18 @@ module Pod
end
end
def
self
.
run
(
*
argv
)
def
self
.
run
(
*
argv
)
parse
(
*
argv
).
run
begin
rescue
Exception
=>
e
Setup
.
new
(
ARGV
.
new
()).
run_if_needed
if
e
.
is_a?
(
Informative
)
parse
(
*
argv
).
run
puts
e
.
message
rescue
Exception
=>
e
puts
*
e
.
backtrace
if
Config
.
instance
.
verbose
if
e
.
is_a?
(
Informative
)
else
puts
e
.
message
puts
ErrorReport
.
report
(
e
)
puts
*
e
.
backtrace
if
Config
.
instance
.
verbose
else
puts
ErrorReport
.
report
(
e
)
end
exit
1
end
end
exit
1
end
end
def
self
.
parse
(
*
argv
)
def
self
.
parse
(
*
argv
)
...
...
lib/cocoapods/command/setup.rb
View file @
7349d6b7
...
@@ -47,17 +47,24 @@ module Pod
...
@@ -47,17 +47,24 @@ module Pod
end
end
end
end
def
origin_url_read_only?
read_master_repo_url
.
chomp
==
read_only_url
end
def
origin_url_push?
def
origin_url_push?
Dir
.
chdir
(
dir
)
do
read_master_repo_url
.
chomp
==
read_write_url
origin_url
=
git
(
'config --get remote.origin.url'
)
origin_url
.
chomp
==
read_write_url
end
end
end
def
push?
def
push?
@push_option
||
(
dir
.
exist?
&&
origin_url_push?
)
@push_option
||
(
dir
.
exist?
&&
origin_url_push?
)
end
end
def
read_master_repo_url
Dir
.
chdir
(
dir
)
do
origin_url
=
git
(
'config --get remote.origin.url'
)
end
end
def
set_master_repo_url
def
set_master_repo_url
Dir
.
chdir
(
dir
)
do
Dir
.
chdir
(
dir
)
do
git
(
"remote set-url origin '
#{
url
}
'"
)
git
(
"remote set-url origin '
#{
url
}
'"
)
...
@@ -72,6 +79,10 @@ module Pod
...
@@ -72,6 +79,10 @@ module Pod
Repo
.
new
(
ARGV
.
new
([
'update'
,
'master'
]))
Repo
.
new
(
ARGV
.
new
([
'update'
,
'master'
]))
end
end
def
run_if_needed
run
if
!
dir
.
exist?
end
def
run
def
run
puts
"Using push access"
if
push?
&&
!
config
.
silent
puts
"Using push access"
if
push?
&&
!
config
.
silent
if
dir
.
exist?
if
dir
.
exist?
...
...
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