mirror of
https://github.com/esphome/esphome.git
synced 2026-05-27 11:56:11 +08:00
[cli] Report program path on host (#12743)
This commit is contained in:
+9
-5
@@ -789,7 +789,13 @@ def command_compile(args: ArgsProtocol, config: ConfigType) -> int | None:
|
|||||||
exit_code = compile_program(args, config)
|
exit_code = compile_program(args, config)
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
return exit_code
|
return exit_code
|
||||||
_LOGGER.info("Successfully compiled program.")
|
if CORE.is_host:
|
||||||
|
from esphome.platformio_api import get_idedata
|
||||||
|
|
||||||
|
program_path = str(get_idedata(config).firmware_elf_path)
|
||||||
|
_LOGGER.info("Successfully compiled program to path '%s'", program_path)
|
||||||
|
else:
|
||||||
|
_LOGGER.info("Successfully compiled program.")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
@@ -839,10 +845,8 @@ def command_run(args: ArgsProtocol, config: ConfigType) -> int | None:
|
|||||||
if CORE.is_host:
|
if CORE.is_host:
|
||||||
from esphome.platformio_api import get_idedata
|
from esphome.platformio_api import get_idedata
|
||||||
|
|
||||||
idedata = get_idedata(config)
|
program_path = str(get_idedata(config).firmware_elf_path)
|
||||||
if idedata is None:
|
_LOGGER.info("Running program from path '%s'", program_path)
|
||||||
return 1
|
|
||||||
program_path = idedata.raw["prog_path"]
|
|
||||||
return run_external_process(program_path)
|
return run_external_process(program_path)
|
||||||
|
|
||||||
# Get devices, resolving special identifiers like OTA
|
# Get devices, resolving special identifiers like OTA
|
||||||
|
|||||||
Reference in New Issue
Block a user