修复 task_before/task_after 中换行后 crontab 不识别

This commit is contained in:
whyour 2024-08-31 20:46:00 +08:00
parent 459f465f3b
commit a41dd74048

View File

@ -564,11 +564,13 @@ export default class CronService {
if (tab.task_before) {
commandVariable += `task_before='${tab.task_before
.replace(/'/g, "'\\''")
.replace(/;? *\n/g, ';')
.trim()}' `;
}
if (tab.task_after) {
commandVariable += `task_after='${tab.task_after
.replace(/'/g, "'\\''")
.replace(/;? *\n/g, ';')
.trim()}' `;
}