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
df6872de
Unverified
Commit
df6872de
authored
Jan 22, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Jan 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7349 from CocoaPods/seg-pod-repo-push-no-overwrite
[Repo::Push] Allow disabling overwriting published specs
parents
a1799f05
5eb747a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
push.rb
lib/cocoapods/command/repo/push.rb
+5
-0
push_spec.rb
spec/functional/command/repo/push_spec.rb
+14
-0
No files found.
CHANGELOG.md
View file @
df6872de
...
@@ -16,6 +16,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -16,6 +16,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Keith Smiley
](
https://github.com/keith
)
[
Keith Smiley
](
https://github.com/keith
)
[
#7346
](
https://github.com/CocoaPods/CocoaPods/pull/7346
)
[
#7346
](
https://github.com/CocoaPods/CocoaPods/pull/7346
)
*
Add a
`--no-overwrite`
flag to
`pod repo push`
to disable overwriting
existing specs that have already been pushed.
[
Samuel Giddins
](
https://github.com/segiddins
)
##### Bug Fixes
##### Bug Fixes
*
Unique all available pre-release versions when displaying
*
Unique all available pre-release versions when displaying
...
...
lib/cocoapods/command/repo/push.rb
View file @
df6872de
...
@@ -36,6 +36,7 @@ module Pod
...
@@ -36,6 +36,7 @@ module Pod
[
'--use-json'
,
'Push JSON spec to repo'
],
[
'--use-json'
,
'Push JSON spec to repo'
],
[
'--swift-version=VERSION'
,
'The SWIFT_VERSION that should be used when linting the spec. '
\
[
'--swift-version=VERSION'
,
'The SWIFT_VERSION that should be used when linting the spec. '
\
'This takes precedence over a .swift-version file.'
],
'This takes precedence over a .swift-version file.'
],
[
'--no-overwrite'
,
'Disallow pushing that would overwrite an existing spec.'
],
].
concat
(
super
)
].
concat
(
super
)
end
end
...
@@ -54,6 +55,7 @@ module Pod
...
@@ -54,6 +55,7 @@ module Pod
@swift_version
=
argv
.
option
(
'swift-version'
,
nil
)
@swift_version
=
argv
.
option
(
'swift-version'
,
nil
)
@skip_import_validation
=
argv
.
flag?
(
'skip-import-validation'
,
false
)
@skip_import_validation
=
argv
.
flag?
(
'skip-import-validation'
,
false
)
@skip_tests
=
argv
.
flag?
(
'skip-tests'
,
false
)
@skip_tests
=
argv
.
flag?
(
'skip-tests'
,
false
)
@allow_overwrite
=
argv
.
flag?
(
'overwrite'
,
true
)
super
super
end
end
...
@@ -183,6 +185,9 @@ module Pod
...
@@ -183,6 +185,9 @@ module Pod
if
@message
&&
!
@message
.
empty?
if
@message
&&
!
@message
.
empty?
message
=
@message
message
=
@message
elsif
output_path
.
exist?
elsif
output_path
.
exist?
unless
@allow_overwrite
raise
Informative
,
"
#{
spec
}
already exists and overwriting has been disabled."
end
message
=
"[Fix]
#{
spec
}
"
message
=
"[Fix]
#{
spec
}
"
elsif
output_path
.
dirname
.
directory?
elsif
output_path
.
dirname
.
directory?
message
=
"[Update]
#{
spec
}
"
message
=
"[Update]
#{
spec
}
"
...
...
spec/functional/command/repo/push_spec.rb
View file @
df6872de
...
@@ -108,6 +108,20 @@ module Pod
...
@@ -108,6 +108,20 @@ module Pod
(
@upstream
+
'PushTest/1.4/PushTest.podspec'
).
should
.
not
.
exist?
(
@upstream
+
'PushTest/1.4/PushTest.podspec'
).
should
.
not
.
exist?
end
end
it
'refuses to push if --no-overwrite is passed and the spec exists'
do
cmd
=
command
(
'repo'
,
'push'
,
'master'
,
'JSONKit.podspec'
,
'--no-overwrite'
)
Dir
.
chdir
(
@upstream
)
{
`git checkout -b tmp_for_push -q`
}
cmd
.
expects
(
:validate_podspec_files
).
returns
(
true
)
e
=
lambda
{
Dir
.
chdir
(
temporary_directory
)
{
cmd
.
run
}
}.
should
.
raise
Pod
::
Informative
e
.
message
.
should
==
'[!] JSONKit (1.4) already exists and overwriting has been disabled.'
cmd
=
command
(
'repo'
,
'push'
,
'master'
,
'PushTest.podspec'
,
'--no-overwrite'
)
cmd
.
expects
(
:validate_podspec_files
).
returns
(
true
)
Dir
.
chdir
(
temporary_directory
)
{
cmd
.
run
}
Pod
::
UI
.
output
.
should
.
include
(
'[Add] PushTest (1.4)'
)
end
it
'generate a message for commit'
do
it
'generate a message for commit'
do
cmd
=
command
(
'repo'
,
'push'
,
'master'
)
cmd
=
command
(
'repo'
,
'push'
,
'master'
)
Dir
.
chdir
(
@upstream
)
{
`git checkout -b tmp_for_push -q`
}
Dir
.
chdir
(
@upstream
)
{
`git checkout -b tmp_for_push -q`
}
...
...
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