Merge pull request #2899 from cryzed/jseval-expand-tilde
Expand ~ to user's home on Linux
This commit is contained in:
commit
2957c4e55f
@ -2048,8 +2048,9 @@ class CommandDispatcher:
|
|||||||
message.info(out)
|
message.info(out)
|
||||||
|
|
||||||
if file:
|
if file:
|
||||||
|
path = os.path.expanduser(js_code)
|
||||||
try:
|
try:
|
||||||
with open(js_code, 'r', encoding='utf-8') as f:
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
js_code = f.read()
|
js_code = f.read()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise cmdexc.CommandError(str(e))
|
raise cmdexc.CommandError(str(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user