From 4bb340efbdfce79cf7bc06e6d743562349da4b52 Mon Sep 17 00:00:00 2001 From: Cooper Hammond Date: Wed, 29 May 2019 08:10:15 -0700 Subject: [PATCH] update environment variables --- irs/cli/config_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/irs/cli/config_parser.py b/irs/cli/config_parser.py index 2f5a4a1..481369e 100644 --- a/irs/cli/config_parser.py +++ b/irs/cli/config_parser.py @@ -7,9 +7,10 @@ import yaml def parse_config(): """Parses config using environment variables.""" - check_for_and_set("irs_config_dir", os.environ["HOME"] + "/.irs", None) + home = os.environ.get("HOME") or os.path.expanduser("~/") + + check_for_and_set("irs_config_dir", home + "/.irs", None) - home = os.environ["HOME"] check_for = [home + "/.irs/config.yml", home + "/.irs/bin/ffmpeg", home + "/.irs/bin/ffprobe"] @@ -33,7 +34,7 @@ def parse_config(): "SPOTIFY_KEYS").get("CLIENT_SECRET"), None) check_for_and_set("irs_music_dir", os.path.expanduser(config.get("music_directory")), - os.environ["HOME"] + "/Music") + home + "/Music") check_for_and_set("irs_ffmpeg_dir", os.environ["irs_config_dir"] + "/bin", None)