diff --git a/src/open_default_files.py b/src/open_default_files.py index 0c39ae3..7f0367d 100644 --- a/src/open_default_files.py +++ b/src/open_default_files.py @@ -10,8 +10,9 @@ def open_all(): raise KeyError('$HOME is not set') from err # If the directory doesn't exist, just return empty + sshwot_dir_path = os.path.join(homedir, '.sshwot') try: - sshwot_dir = os.listdir(os.path.join(homedir, '.sshwot')) + sshwot_dir = os.listdir(sshwot_dir_path) except FileNotFoundError: return [] @@ -19,6 +20,7 @@ def open_all(): files = [] for dir_entry in sshwot_dir: if dir_entry.split('.')[-1] == 'sshwot': - files.append(open(dir_entry, 'rb')) + path = os.path.join(sshwot_dir_path, dir_entry) + files.append(open(path, 'rb')) return files