Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regex match for cronjob cleanup #224

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Conversation

shreddedbacon
Copy link
Member

This fixes the regex for cronjob cleanup so that it will remove cronjobs that don't exist.

Previously if I had a cronjob named drush cron and then renamed it to be drush cron different. The current regex check would mean that both of these cronjobs would remain. drush cron would not get cleaned up, when it should.

current

re='\<cronjob-cli-drush-cron\>'
text=cronjob-cli-drush-cron
$ if [[ "$text" =~ $re ]]; then echo match; fi
match
text=cronjob-cli-drush-cron-different
$ if [[ "$text" =~ $re ]]; then echo match; fi
match

fixed

re='\<^cronjob-cli-drush-cron$\>'
text=cronjob-cli-drush-cron
$ if [[ "$text" =~ $re ]]; then echo match; fi
match
text=cronjob-cli-drush-cron-different
$ if [[ "$text" =~ $re ]]; then echo match; fi

@shreddedbacon shreddedbacon marked this pull request as ready for review July 25, 2023 05:37
@tobybellwood tobybellwood added this to the v2.16 tie-in release milestone Sep 18, 2023
Copy link
Member

@tobybellwood tobybellwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tobybellwood tobybellwood merged commit 7ae7dca into main Oct 9, 2023
@tobybellwood tobybellwood deleted the cronjob-cleanup-regex branch October 9, 2023 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants