option to clear all releases from crontab#613
Conversation
lib/whenever/command_line.rb
Outdated
| system "crontab -l | sed 's/>/>>/' | crontab - " | ||
| # Remove crontab | ||
| system "crontab -r" | ||
| # Reinitilize |
There was a problem hiding this comment.
Reinitilize => Reinitialize
lib/whenever/version.rb
Outdated
| @@ -1,3 +1,3 @@ | |||
| module Whenever | |||
| VERSION = '0.9.4' | |||
| VERSION = '0.9.5' | |||
There was a problem hiding this comment.
Don't bump version in a PR to add something. The bumping of the version is a part of the release process.
lib/whenever/command_line.rb
Outdated
|
|
||
| if [@options[:update], @options[:write], @options[:clear]].compact.length > 1 | ||
| if [@options[:update], @options[:write], @options[:clear], options[:clear_all]].compact.length > 1 | ||
| warn("[fail] Can only update, write or clear. Choose one.") |
There was a problem hiding this comment.
Include "clear_all" in this warn message.
bin/whenever
Outdated
| options[:clear] = true | ||
| options[:identifier] = identifier if identifier | ||
| end | ||
| opts.on('-a', '--clear-all-flags-crontab') do |identifier| |
There was a problem hiding this comment.
opts.on takes a third argument which is the user-visible documentation string for this option. Include one here.
We don't use the block argument, so I think you should remove it from this block.
|
@altherlex Have you had a chance to revisit this PR? I'd like to see it get merged as we are also running into issues with leftover crons when switching environments. |
|
@javan @olleolleolle @benlangfeld Any news about this PR? That's a great feature. |
|
+100 This clear-all option is desperately needed! |
reset crontab file
You need it when you have many releases (like OpsWorks) but it necessary reset the cron.