From 9bb331941f4f5d5781bcce8de0a794d181a1dd94 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 6 Nov 2024 18:32:11 -0800 Subject: [PATCH] Fix crontab on systems without crontab --- intake/crontab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intake/crontab.py b/intake/crontab.py index 934a5c0..7d01691 100644 --- a/intake/crontab.py +++ b/intake/crontab.py @@ -30,8 +30,8 @@ def update_crontab_entries(data_path: Path): # If there is no crontab command available, quit early. cmd = ("command", "-v", "crontab") print("Executing", *cmd, file=sys.stderr) - crontab_exists = subprocess.run(cmd, shell=True) - if crontab_exists.returncode: + crontab_exists = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE) + if not crontab_exists.stdout: print("Could not update crontab", file=sys.stderr) return