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
63a39cff
Commit
63a39cff
authored
Sep 08, 2016
by
Ben Asher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Dir.chdir's from the push command
parent
03d8362e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
push.rb
lib/cocoapods/command/repo/push.rb
+13
-9
No files found.
lib/cocoapods/command/repo/push.rb
View file @
63a39cff
...
@@ -96,7 +96,7 @@ module Pod
...
@@ -96,7 +96,7 @@ module Pod
# specs to the master repo.
# specs to the master repo.
#
#
def
check_if_master_repo
def
check_if_master_repo
remotes
=
Dir
.
chdir
(
repo_dir
)
{
`git remote -v 2>&1`
}
remotes
=
`git -C
#{
repo_dir
}
remote -v 2>&1`
master_repo_urls
=
[
master_repo_urls
=
[
'git@github.com:CocoaPods/Specs.git'
,
'git@github.com:CocoaPods/Specs.git'
,
'https://github.com/CocoaPods/Specs.git'
,
'https://github.com/CocoaPods/Specs.git'
,
...
@@ -145,7 +145,7 @@ module Pod
...
@@ -145,7 +145,7 @@ module Pod
# @return [void]
# @return [void]
#
#
def
check_repo_status
def
check_repo_status
clean
=
Dir
.
chdir
(
repo_dir
)
{
`git status --porcelain 2>&1`
}
==
''
clean
=
`git -C
#{
repo_dir
}
status --porcelain 2>&1`
==
''
raise
Informative
,
"The repo `
#{
@repo
}
` at
#{
UI
.
path
repo_dir
}
is not clean"
unless
clean
raise
Informative
,
"The repo `
#{
@repo
}
` at
#{
UI
.
path
repo_dir
}
is not clean"
unless
clean
end
end
...
@@ -155,7 +155,7 @@ module Pod
...
@@ -155,7 +155,7 @@ module Pod
#
#
def
update_repo
def
update_repo
UI
.
puts
"Updating the `
#{
@repo
}
' repo
\n
"
.
yellow
UI
.
puts
"Updating the `
#{
@repo
}
' repo
\n
"
.
yellow
Dir
.
chdir
(
repo_dir
)
{
UI
.
puts
`git pull 2>&1`
}
UI
.
puts
`git -C
#{
repo_dir
}
pull 2>&1`
end
end
# Commits the podspecs to the source, which should be a git repo.
# Commits the podspecs to the source, which should be a git repo.
...
@@ -189,18 +189,16 @@ module Pod
...
@@ -189,18 +189,16 @@ module Pod
FileUtils
.
cp
(
spec_file
,
output_path
)
FileUtils
.
cp
(
spec_file
,
output_path
)
end
end
Dir
.
chdir
(
repo_dir
)
do
# only commit if modified
# only commit if modified
if
git!
(
'status'
,
'--porcelain'
).
include?
(
spec
.
name
)
if
repo_git
(
'status'
,
'--porcelain'
).
include?
(
spec
.
name
)
UI
.
puts
" -
#{
message
}
"
UI
.
puts
" -
#{
message
}
"
git!
(
'add'
,
spec
.
name
)
repo_git
(
'add'
,
spec
.
name
)
git!
(
'commit'
,
'--no-verify'
,
'-m'
,
message
)
repo_git
(
'commit'
,
'--no-verify'
,
'-m'
,
message
)
else
else
UI
.
puts
" - [No change]
#{
spec
}
"
UI
.
puts
" - [No change]
#{
spec
}
"
end
end
end
end
end
end
end
# Pushes the git repo against the remote.
# Pushes the git repo against the remote.
#
#
...
@@ -208,7 +206,7 @@ module Pod
...
@@ -208,7 +206,7 @@ module Pod
#
#
def
push_repo
def
push_repo
UI
.
puts
"
\n
Pushing the `
#{
@repo
}
' repo
\n
"
.
yellow
UI
.
puts
"
\n
Pushing the `
#{
@repo
}
' repo
\n
"
.
yellow
Dir
.
chdir
(
repo_dir
)
{
UI
.
puts
`git push origin master 2>&1`
}
UI
.
puts
`git -C
#{
repo_dir
}
push origin master 2>&1`
end
end
#---------------------------------------------------------------------#
#---------------------------------------------------------------------#
...
@@ -217,6 +215,12 @@ module Pod
...
@@ -217,6 +215,12 @@ module Pod
# @!group Private helpers
# @!group Private helpers
# @return result of calling the git! with args in repo_dir
#
def
repo_git
(
*
args
)
git!
([
"-C"
,
repo_dir
]
+
args
)
end
# @return [Pathname] The directory of the repository.
# @return [Pathname] The directory of the repository.
#
#
def
repo_dir
def
repo_dir
...
...
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