Made version command handle no .version file case.

This commit is contained in:
Geoff Taylor 2021-06-25 18:04:55 +01:00
parent 7c992b2b07
commit 115ccf1db3
1 changed files with 6 additions and 2 deletions

View File

@ -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}'.")