mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 05:02:07 +00:00
rearrange to more reliably detect urls
This commit is contained in:
parent
7f398eea50
commit
0177fbd65b
@ -70,10 +70,6 @@ def kle2json(cli):
|
|||||||
file_path = Path(os.environ['ORIG_CWD'], cli.args.kle)
|
file_path = Path(os.environ['ORIG_CWD'], cli.args.kle)
|
||||||
|
|
||||||
# Find our KLE text
|
# 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:
|
if cli.args.kle.startswith('http') and '#' in cli.args.kle:
|
||||||
kle_path = cli.args.kle.split('#', 1)[1]
|
kle_path = cli.args.kle.split('#', 1)[1]
|
||||||
if 'gists' not in kle_path:
|
if 'gists' not in kle_path:
|
||||||
@ -82,6 +78,9 @@ def kle2json(cli):
|
|||||||
else:
|
else:
|
||||||
raw_code = fetch_kle(kle_path.split('/')[-1])
|
raw_code = fetch_kle(kle_path.split('/')[-1])
|
||||||
|
|
||||||
|
elif file_path.exists():
|
||||||
|
raw_code = file_path.open().read()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raw_code = fetch_kle(cli.args.kle)
|
raw_code = fetch_kle(cli.args.kle)
|
||||||
if not raw_code:
|
if not raw_code:
|
||||||
|
Loading…
Reference in New Issue
Block a user