Skip to content

Commit d7fb03b

Browse files
committed
fix if there's no date command
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
1 parent f52724b commit d7fb03b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tymely/tymely.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ async def main_async() -> None:
144144
print(f"{date_str} from {url} returned but not set", file=sys.stdout)
145145
return
146146

147-
date_cmd: str | None = shutil.which("date")
147+
date_cmd = shutil.which("date")
148+
if date_cmd is None:
149+
print("'date' command not found", file=sys.stderr)
150+
sys.exit(1)
151+
148152
subprocess.run( # noqa: S603, ASYNC221
149153
[date_cmd, "-s", date_str],
150154
shell=False,

0 commit comments

Comments
 (0)