Skip to content

Commit 58ba725

Browse files
committed
add the ability to change the target file in the --stay-connected menu
1 parent a58f94d commit 58ba725

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

pybricksdev/cli/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ async def reconnect_hub():
262262
return hub
263263

264264
response_options = [
265+
"Change Target File",
265266
"Recompile and Run",
266267
"Recompile and Download",
267268
"Exit",
@@ -292,8 +293,18 @@ async def reconnect_hub():
292293
)
293294
with _get_script_path(args.file) as script_path:
294295
if response == response_options[0]:
295-
await hub.run(script_path, wait=True)
296+
args.file = os.path.abspath(
297+
await hub.race_disconnect(
298+
hub.race_power_button_press(
299+
questionary.path(
300+
"What file would you like to use?"
301+
).ask_async()
302+
)
303+
)
304+
)
296305
elif response == response_options[1]:
306+
await hub.run(script_path, wait=True)
307+
elif response == response_options[2]:
297308
await hub.download(script_path)
298309
else:
299310
return

0 commit comments

Comments
 (0)