rearrange to more reliably detect urls

This commit is contained in:
Zach White 2021-01-07 20:42:37 -08:00
parent 7f398eea50
commit 0177fbd65b

View File

@ -70,10 +70,6 @@ def kle2json(cli):
file_path = Path(os.environ['ORIG_CWD'], cli.args.kle)
# Find our KLE text
if file_path.exists():
raw_code = file_path.open().read()
else:
if cli.args.kle.startswith('http') and '#' in cli.args.kle:
kle_path = cli.args.kle.split('#', 1)[1]
if 'gists' not in kle_path:
@ -82,6 +78,9 @@ def kle2json(cli):
else:
raw_code = fetch_kle(kle_path.split('/')[-1])
elif file_path.exists():
raw_code = file_path.open().read()
else:
raw_code = fetch_kle(cli.args.kle)
if not raw_code: