diff --git a/install.py b/install.py index 94a2449..7d89594 100755 --- a/install.py +++ b/install.py @@ -7,6 +7,7 @@ Inspired by https://github.com/dmerejkowsky/dotfiles import argparse import subprocess +import sys from typing import List, Optional from urllib.request import urlretrieve @@ -38,15 +39,18 @@ class Installer: def verify_secrets(self) -> None: """The repository contains a secrets.template, that must be taken care of - by the user. If the secrets is wrong, fail. + by the user. If the secrets is wrong, or missing, fail. """ try: with open("secrets", "r") as secrets_file: secrets = secrets_file.read() - # TODO: check the contents too except FileNotFoundError: - raise AssertionError("Did you forget to create a 'secrets' file?") + print("No 'secrets' file found. Did you forget to create it?") + sys.exit(1) + else: + pass + # TODO: check the contents of the file def define_os(self) -> str: """Define what OS we are using."""