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
d4eac5e9
Commit
d4eac5e9
authored
Nov 24, 2015
by
Bart Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Repo Command] Add ability to add custom commit message when pushing spec
parent
e547edd6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
push.rb
lib/cocoapods/command/repo/push.rb
+22
-1
No files found.
CHANGELOG.md
View file @
d4eac5e9
...
@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
##### Enhancements
*
Add the ability to add a custom commit message when pushing a spec.
[
Bart Jacobs
](
https://github.com/bartjacobs
)
[
#4583
](
https://github.com/CocoaPods/CocoaPods/issues/4583
)
*
Added support for
`pod env`
to print the pod environment without having to crash.
*
Added support for
`pod env`
to print the pod environment without having to crash.
[
Hemal Shah
](
https://github.com/hemal
)
[
Hemal Shah
](
https://github.com/hemal
)
[
#3660
](
https://github.com/CocoaPods/CocoaPods/issues/3660
)
[
#3660
](
https://github.com/CocoaPods/CocoaPods/issues/3660
)
...
...
lib/cocoapods/command/repo/push.rb
View file @
d4eac5e9
require
'tempfile'
require
'fileutils'
require
'fileutils'
require
'active_support/core_ext/string/inflections'
require
'active_support/core_ext/string/inflections'
...
@@ -28,6 +29,7 @@ module Pod
...
@@ -28,6 +29,7 @@ module Pod
'Multiple sources must be comma-delimited.'
],
'Multiple sources must be comma-delimited.'
],
[
'--local-only'
,
'Does not perform the step of pushing REPO to its remote'
],
[
'--local-only'
,
'Does not perform the step of pushing REPO to its remote'
],
[
'--no-private'
,
'Lint includes checks that apply only to public repos'
],
[
'--no-private'
,
'Lint includes checks that apply only to public repos'
],
[
'--message'
,
'Add custom commit message'
]
].
concat
(
super
)
].
concat
(
super
)
end
end
...
@@ -39,6 +41,7 @@ module Pod
...
@@ -39,6 +41,7 @@ module Pod
@podspec
=
argv
.
shift_argument
@podspec
=
argv
.
shift_argument
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@private
=
argv
.
flag?
(
'private'
,
true
)
@private
=
argv
.
flag?
(
'private'
,
true
)
@message
=
argv
.
flag?
(
'message'
)
super
super
end
end
...
@@ -48,6 +51,7 @@ module Pod
...
@@ -48,6 +51,7 @@ module Pod
end
end
def
run
def
run
open_editor
if
@message
check_if_master_repo
check_if_master_repo
validate_podspec_files
validate_podspec_files
check_repo_status
check_repo_status
...
@@ -65,6 +69,21 @@ module Pod
...
@@ -65,6 +69,21 @@ module Pod
extend
Executable
extend
Executable
executable
:git
executable
:git
# Open default editor to allow users to enter commit message
#
def
open_editor
file
=
Tempfile
.
new
(
'cocoapods'
)
File
.
chmod
(
0777
,
file
.
path
)
file
.
close
unless
ENV
[
'EDITOR'
].
nil?
system
(
"
#{
ENV
[
'EDITOR'
]
}
#{
file
.
path
}
"
)
@message
=
File
.
read
file
.
path
else
@message
=
nil
end
end
# Temporary check to ensure that users do not push accidentally private
# Temporary check to ensure that users do not push accidentally private
# specs to the master repo.
# specs to the master repo.
#
#
...
@@ -143,7 +162,9 @@ module Pod
...
@@ -143,7 +162,9 @@ module Pod
podspec_files
.
each
do
|
spec_file
|
podspec_files
.
each
do
|
spec_file
|
spec
=
Pod
::
Specification
.
from_file
(
spec_file
)
spec
=
Pod
::
Specification
.
from_file
(
spec_file
)
output_path
=
File
.
join
(
repo_dir
,
spec
.
name
,
spec
.
version
.
to_s
)
output_path
=
File
.
join
(
repo_dir
,
spec
.
name
,
spec
.
version
.
to_s
)
if
Pathname
.
new
(
output_path
).
exist?
if
@message
&&
!
@message
.
empty?
message
=
@message
elsif
Pathname
.
new
(
output_path
).
exist?
message
=
"[Fix]
#{
spec
}
"
message
=
"[Fix]
#{
spec
}
"
elsif
Pathname
.
new
(
File
.
join
(
repo_dir
,
spec
.
name
)).
exist?
elsif
Pathname
.
new
(
File
.
join
(
repo_dir
,
spec
.
name
)).
exist?
message
=
"[Update]
#{
spec
}
"
message
=
"[Update]
#{
spec
}
"
...
...
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