fix loading config when passed on the command line

pull/54/head
Cereal Killer 9 years ago
parent c15365f93e
commit f1da5974f0

@ -45,12 +45,13 @@ parser.add_argument(
)
args = parser.parse_args()
config = None
if args.config:
config.read(args.config)
config_file = args.config
else:
with open('shreddit.yml', 'r') as fh:
config = yaml.safe_load(fh)
config_file = 'shreddit.yml'
with open(config_file, 'r') as fh:
config = yaml.safe_load(fh)
if config is None:
raise Exception("No config options passed!")

Loading…
Cancel
Save