@@ -1030,18 +1030,14 @@ namespace :all do
1030
1030
Rake ::Task [ 'all:docs' ] . invoke
1031
1031
Rake ::Task [ 'all:version' ] . invoke ( 'nightly' )
1032
1032
1033
- puts "Staging nightly version updates"
1034
- @git . add ( [ 'java/version.bzl' ,
1035
- 'rb/lib/selenium/webdriver/version.rb' ,
1036
- 'rb/Gemfile.lock' ,
1037
- 'rust/BUILD.bazel' ,
1038
- 'rust/Cargo.Bazel.lock' ,
1039
- 'rust/Cargo.lock' ,
1040
- 'rust/Cargo.toml' ] ,
1041
- all : true )
1042
1033
puts "Committing nightly version updates"
1043
- @git . commit ( 'update versions to nightly' )
1044
- puts "Pushing changes to upstream repository"
1034
+ commit! ( 'update versions to nightly' , [ 'java/version.bzl' ,
1035
+ 'rb/lib/selenium/webdriver/version.rb' ,
1036
+ 'rb/Gemfile.lock' ,
1037
+ 'rust/BUILD.bazel' ,
1038
+ 'rust/Cargo.Bazel.lock' ,
1039
+ 'rust/Cargo.lock' ,
1040
+ 'rust/Cargo.toml' ] )
1045
1041
1046
1042
print 'Do you want to push the committed changes? (Y/n): '
1047
1043
response = STDIN . gets . chomp . downcase
@@ -1175,15 +1171,12 @@ def update_gh_pages
1175
1171
end
1176
1172
end
1177
1173
1178
- puts "Staging changes for commit"
1179
- @git . add ( 'docs/api' , all : true )
1180
-
1181
1174
print 'Do you want to commit the changes? (Y/n): '
1182
1175
response = STDIN . gets . chomp . downcase
1183
1176
return restore_git ( origin_reference ) unless response == 'y' || response == 'yes'
1184
1177
1185
1178
puts "Committing changes"
1186
- @git . commit ( 'updating all API docs' )
1179
+ commit! ( 'updating all API docs' , 'docs/api/ ')
1187
1180
1188
1181
puts "Pushing changes to upstream repository"
1189
1182
@git . push
@@ -1246,3 +1239,13 @@ def update_changelog(version, language, path, changelog, header)
1246
1239
file . truncate ( file . pos )
1247
1240
end
1248
1241
end
1242
+
1243
+ def commit! ( message , files = [ ] , all : false )
1244
+ files . each do |file |
1245
+ puts "adding: #{ file } "
1246
+ @git . add ( file )
1247
+ end
1248
+ all ? @git . commit_all ( message ) : @git . commit ( message )
1249
+ rescue Git ::FailedError => ex
1250
+ puts ex . message
1251
+ end
0 commit comments