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
dc928273
Commit
dc928273
authored
Jul 15, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1199 from shekibobo/pod-push-unchanged
Don't try to commit unchanged specs on push
parents
1627efb4
bf741f02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
CHANGELOG.md
CHANGELOG.md
+7
-0
push.rb
lib/cocoapods/command/push.rb
+10
-5
push_spec.rb
spec/functional/command/push_spec.rb
+6
-1
No files found.
CHANGELOG.md
View file @
dc928273
...
@@ -2,6 +2,13 @@
...
@@ -2,6 +2,13 @@
To install or update CocoaPods see this
[
guide
](
http://docs.cocoapods.org/guides/installing_cocoapods.html
)
.
To install or update CocoaPods see this
[
guide
](
http://docs.cocoapods.org/guides/installing_cocoapods.html
)
.
## Master (Unreleased)
###### Bug Fixes
*
Fixed issue with
`pod push`
failing when the podspec is unchanged. It will now
report
`[No change] ExamplePod (0.1.0)`
and continue to push other podspecs if
they exist.
[
#1199
](
https://github.com/CocoaPods/CocoaPods/pull/1199
)
## 0.22.2
## 0.22.2
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.22.1...0.22.2
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.22.1...0.22.2
)
...
...
lib/cocoapods/command/push.rb
View file @
dc928273
...
@@ -8,7 +8,7 @@ module Pod
...
@@ -8,7 +8,7 @@ module Pod
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
Validates NAME.podspec or `*.podspec' in the current working dir, creates
Validates NAME.podspec or `*.podspec' in the current working dir, creates
a directory and version folder for the pod in the local copy of
a directory and version folder for the pod in the local copy of
REPO (~/.cocoapods/[REPO]), copies the podspec file into the version directory,
REPO (~/.cocoapods/[REPO]), copies the podspec file into the version directory,
and finally it pushes REPO to its remote.
and finally it pushes REPO to its remote.
DESC
DESC
...
@@ -79,7 +79,7 @@ module Pod
...
@@ -79,7 +79,7 @@ module Pod
#
#
# @todo Add specs for staged and unstaged files.
# @todo Add specs for staged and unstaged files.
#
#
# @todo Gracefully handle the case where source is not under git
# @todo Gracefully handle the case where source is not under git
# source control.
# source control.
#
#
# @return [void]
# @return [void]
...
@@ -117,13 +117,18 @@ module Pod
...
@@ -117,13 +117,18 @@ module Pod
else
else
message
=
"[Add]
#{
spec
}
"
message
=
"[Add]
#{
spec
}
"
end
end
UI
.
puts
" -
#{
message
}
"
FileUtils
.
mkdir_p
(
output_path
)
FileUtils
.
mkdir_p
(
output_path
)
FileUtils
.
cp
(
spec_file
,
output_path
)
FileUtils
.
cp
(
spec_file
,
output_path
)
Dir
.
chdir
(
repo_dir
)
do
Dir
.
chdir
(
repo_dir
)
do
git!
(
"add
#{
spec
.
name
}
"
)
# only commit if modified
git!
(
"commit --no-verify -m '
#{
message
}
'"
)
if
git!
(
"status --porcelain 2>&1"
)
=~
/
#{
spec
.
name
}
/
UI
.
puts
" -
#{
message
}
"
git!
(
"add
#{
spec
.
name
}
"
)
git!
(
"commit --no-verify -m '
#{
message
}
'"
)
else
UI
.
puts
" - [No change]
#{
spec
}
"
end
end
end
end
end
end
end
...
...
spec/functional/command/push_spec.rb
View file @
dc928273
...
@@ -53,11 +53,15 @@ module Pod
...
@@ -53,11 +53,15 @@ module Pod
end
end
# prepare the spec
# prepare the spec
spec
=
(
fixture
(
'spec-repos'
)
+
'
master
/JSONKit/1.4/JSONKit.podspec'
).
read
spec
=
(
fixture
(
'spec-repos'
)
+
'
test_repo
/JSONKit/1.4/JSONKit.podspec'
).
read
spec_fix
=
spec
.
gsub
(
/https:\/\/github\.com\/johnezang\/JSONKit\.git/
,
fixture
(
'integration/JSONKit'
).
to_s
)
spec_fix
=
spec
.
gsub
(
/https:\/\/github\.com\/johnezang\/JSONKit\.git/
,
fixture
(
'integration/JSONKit'
).
to_s
)
spec_add
=
spec
.
gsub
(
/'JSONKit'/
,
"'PushTest'"
)
spec_add
=
spec
.
gsub
(
/'JSONKit'/
,
"'PushTest'"
)
spec_clean
=
(
fixture
(
'spec-repos'
)
+
'test_repo/BananaLib/1.0/BananaLib.podspec'
).
read
File
.
open
(
temporary_directory
+
'JSONKit.podspec'
,
'w'
)
{
|
f
|
f
.
write
(
spec_fix
)
}
File
.
open
(
temporary_directory
+
'JSONKit.podspec'
,
'w'
)
{
|
f
|
f
.
write
(
spec_fix
)
}
File
.
open
(
temporary_directory
+
'PushTest.podspec'
,
'w'
)
{
|
f
|
f
.
write
(
spec_add
)
}
File
.
open
(
temporary_directory
+
'PushTest.podspec'
,
'w'
)
{
|
f
|
f
.
write
(
spec_add
)
}
File
.
open
(
temporary_directory
+
'BananaLib.podspec'
,
'w'
)
{
|
f
|
f
.
write
(
spec_clean
)
}
end
end
it
"refuses to push if the repo is not clean"
do
it
"refuses to push if the repo is not clean"
do
...
@@ -79,6 +83,7 @@ module Pod
...
@@ -79,6 +83,7 @@ module Pod
Dir
.
chdir
(
temporary_directory
)
{
cmd
.
run
}
Dir
.
chdir
(
temporary_directory
)
{
cmd
.
run
}
Pod
::
UI
.
output
.
should
.
include
(
'[Add] PushTest (1.4)'
)
Pod
::
UI
.
output
.
should
.
include
(
'[Add] PushTest (1.4)'
)
Pod
::
UI
.
output
.
should
.
include
(
'[Fix] JSONKit (1.4)'
)
Pod
::
UI
.
output
.
should
.
include
(
'[Fix] JSONKit (1.4)'
)
Pod
::
UI
.
output
.
should
.
include
(
'[No change] BananaLib (1.0)'
)
Dir
.
chdir
(
@upstream
)
{
`git checkout master -q`
}
Dir
.
chdir
(
@upstream
)
{
`git checkout master -q`
}
(
@upstream
+
'PushTest/1.4/PushTest.podspec'
).
read
.
should
.
include
(
'PushTest'
)
(
@upstream
+
'PushTest/1.4/PushTest.podspec'
).
read
.
should
.
include
(
'PushTest'
)
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