Crontab breaks on single quotes in either a command or a comment line #4036
-
Deployer Versionv7.5.12 Target OSUbuntu 22.04 Which PHP version are you using?PHP 7.4 Content of deploy.php or deploy.yamlrequire 'contrib/crontab.php';
after('deploy:success', 'crontab:sync');
add('crontab:jobs', [
// Notice the single quote
'0 0 * * * echo "It\'s deploy time"',
]);
// just run crontab:sync then Steps to reproduceIf either a command or a comment contains a single quote, the task will fail with shell error. Moreover a standard crontab template already has a help comment that contains single quotes (at least on Ubuntu):
Which leads to this error on creating temporary template:
Seems like the content is echo-ed without proper escaping, so there might be other errors because of that. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I went ahead and opened a PR #4042 |
Beta Was this translation helpful? Give feedback.
-
Since PR was merged, I'll mark the thread as answered. One question though. Will it be merged into 7.x branch as well or do I need to open a PR against it, what's the process here? We are on PHP7, so can't use the latest version of the package 🤷 |
Beta Was this translation helpful? Give feedback.
I went ahead and opened a PR #4042