From 115ccf1db3915eb2e90954d97a637e43f6eca3d1 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Fri, 25 Jun 2021 18:04:55 +0100 Subject: [PATCH] Made version command handle no .version file case. --- bin/version | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/version b/bin/version index bcee0b4..b9c750d 100755 --- a/bin/version +++ b/bin/version @@ -2,5 +2,9 @@ import os.path -with open(os.path.join(os.path.dirname(__file__), "../.version")) as version_file: - print(version_file.read()) +version_filename: str = os.path.join(os.path.dirname(__file__), "../.version") +if os.path.isfile(version_filename): + with open(os.path.join(os.path.dirname(__file__), "../.version")) as version_file: + print(version_file.read()) +else: + print(f"No version file found at '{version_filename}'.")