From fa48cda4984ad8eb46dccb2b20d8db67161eee0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Sat, 5 Sep 2020 21:40:41 +0200 Subject: [PATCH] Fixed non zero code returned from the crontab -l command --- src/task/cron.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/task/cron.php b/src/task/cron.php index f34a6f9..a832389 100644 --- a/src/task/cron.php +++ b/src/task/cron.php @@ -44,7 +44,7 @@ task('cron:download', static function (): void { $cronUser = get('cron_user'); - run(sprintf('crontab -l%s 2>/dev/null > existing_crontab.txt', $cronUser !== '' ? (' -u ' . $cronUser) : '')); + run(sprintf('(crontab -l%s 2>/dev/null || true) > existing_crontab.txt', $cronUser !== '' ? (' -u ' . $cronUser) : '')); download('existing_crontab.txt', 'existing_crontab.txt'); })->desc('Downloads existing crontab to existing_crontab.txt file');