File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
# frozen_string_literal: true
3
3
4
- #/ Usage: release [--dry-run] <version> [min_version]
4
+ #/ Usage: release [--dry-run] [--skip-version-bump-check] <version> [min_version]
5
5
#/
6
6
#/ Publish a backup-utils release:
7
7
#/ * Updates the package changelog
196
196
197
197
def bump_version ( new_version , min_version = nil , path = 'share/github-backup-utils/version' )
198
198
current_version = Gem ::Version . new ( File . read ( path ) . strip . chomp )
199
- if Gem ::Version . new ( new_version ) < current_version
199
+ if ! @skip_version_bump_check && ( Gem ::Version . new ( new_version ) < current_version )
200
200
raise "New version should be newer than #{ current_version } "
201
201
end
202
202
File . open ( "#{ path } .new" , 'w' ) { |f | f . puts new_version }
@@ -338,6 +338,7 @@ if $PROGRAM_NAME == __FILE__
338
338
begin
339
339
args = ARGV . dup
340
340
dry_run = false
341
+ skip_version_bump_check = false
341
342
if args . include? ( '--dry-run' )
342
343
dry_run = true
343
344
args . delete '--dry-run'
@@ -348,7 +349,12 @@ if $PROGRAM_NAME == __FILE__
348
349
args . delete '--no-warn'
349
350
end
350
351
351
- raise 'Usage: release [--dry-run] <version> [min_version]' if args . empty?
352
+ if args . include? ( '--skip-version-bump-check' )
353
+ @skip_version_bump_check = true
354
+ args . delete '--skip-version-bump-check'
355
+ end
356
+
357
+ raise 'Usage: release [--dry-run] [--skip-version-bump-check] <version> [min_version]' if args . empty?
352
358
353
359
begin
354
360
version = Gem ::Version . new ( args [ 0 ] )
You can’t perform that action at this time.
0 commit comments