-
Notifications
You must be signed in to change notification settings - Fork 725
option to clear all releases from crontab #613
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -18,7 +18,7 @@ def initialize(options={}) | |||
exit(1) | |||
end | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include "clear_all" in this warn message.
bin/whenever
Outdated
@@ -20,6 +20,9 @@ OptionParser.new do |opts| | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.