mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Improve telemetry for run env command
This commit is contained in:
@ -39,8 +39,6 @@ def cli(environment, target, upload_port):
|
|||||||
|
|
||||||
echo("Processing %s environment:" % style(envname, fg="cyan"))
|
echo("Processing %s environment:" % style(envname, fg="cyan"))
|
||||||
|
|
||||||
telemetry.on_run_environment(envname, config.items(section))
|
|
||||||
|
|
||||||
variables = ["PIOENV=" + envname]
|
variables = ["PIOENV=" + envname]
|
||||||
if upload_port:
|
if upload_port:
|
||||||
variables.append("UPLOAD_PORT=%s" % upload_port)
|
variables.append("UPLOAD_PORT=%s" % upload_port)
|
||||||
@ -59,6 +57,8 @@ def cli(environment, target, upload_port):
|
|||||||
if not config.has_option(section, "platform"):
|
if not config.has_option(section, "platform"):
|
||||||
raise UndefinedEnvPlatform(envname)
|
raise UndefinedEnvPlatform(envname)
|
||||||
|
|
||||||
|
telemetry.on_run_environment(config.items(section), envtargets)
|
||||||
|
|
||||||
p = PlatformFactory().newPlatform(config.get(section, "platform"))
|
p = PlatformFactory().newPlatform(config.get(section, "platform"))
|
||||||
result = p.run(variables, envtargets)
|
result = p.run(variables, envtargets)
|
||||||
secho(result['out'], fg="green")
|
secho(result['out'], fg="green")
|
||||||
|
@ -134,10 +134,10 @@ def on_command(ctx): # pylint: disable=W0613
|
|||||||
resend_backuped_reports()
|
resend_backuped_reports()
|
||||||
|
|
||||||
|
|
||||||
def on_run_environment(name, options): # pylint: disable=W0613
|
def on_run_environment(options, targets):
|
||||||
# on_event("RunEnv", "Name", name)
|
opts = ["%s=%s" % (opt, value) for opt, value in sorted(options)]
|
||||||
for opt, value in options:
|
targets = [t.title() for t in targets or ["run"]]
|
||||||
on_event("RunEnv", opt.title(), value)
|
on_event("Env", " ".join(targets), " ".join(opts))
|
||||||
|
|
||||||
|
|
||||||
def on_event(category, action, label=None, value=None, screen_name=None):
|
def on_event(category, action, label=None, value=None, screen_name=None):
|
||||||
|
Reference in New Issue
Block a user