Update cron.log_name before makeCommand to avoid passing null to shell

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-22 03:20:11 +00:00
parent 103065c1a4
commit 374393b596

View File

@ -510,6 +510,10 @@ export default class CronService {
log_name === '/dev/null'
? await getUniqPath(command, `${id}`)
: log_name || (await getUniqPath(command, `${id}`));
// Update cron.log_name with the calculated uniqPath to avoid passing null to shell
cron.log_name = uniqPath;
const logTime = dayjs().format('YYYY-MM-DD-HH-mm-ss-SSS');
const logDirPath = path.resolve(config.logPath, `${uniqPath}`);
await fs.mkdir(logDirPath, { recursive: true });