mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
handle case where script file is not found
This commit is contained in:
parent
81d3f4847d
commit
0d70b0279d
1 changed files with 6 additions and 0 deletions
|
|
@ -1238,6 +1238,12 @@ async def process_cmds (mc, args, json_output=False) :
|
|||
process_cmds.first=True
|
||||
|
||||
async def process_script(mc, file, json_output=False):
|
||||
if not os.path.exists(file) :
|
||||
logger.info(f"file {file} not found")
|
||||
if json_output :
|
||||
print(json.dumps({"error" : f"file {file} not found"}))
|
||||
return
|
||||
|
||||
with open(file, "r") as f :
|
||||
lines=f.readlines()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue