mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 02:19:00 +08:00
[vcpkg] Fix incorrect handling of messages for permenantly disabled metrics. (#15636)
Fixes #15630
This commit is contained in:
parent
fd67439f01
commit
3f3d9a615a
@ -41,6 +41,12 @@ try {
|
||||
throw "Environment variable did not disable metrics."
|
||||
}
|
||||
|
||||
# Also test that you get no message without --sendmetrics
|
||||
$vcpkgOutput = Run-Vcpkg list
|
||||
if ($vcpkgOutput -contains $metricsAreDisabledMessage) {
|
||||
throw "Disabled metrics emit message even without --sendmetrics"
|
||||
}
|
||||
|
||||
if (-Not (Test-Metrics-Enabled '--no-disable-metrics')) {
|
||||
throw "Environment variable to disable metrics could not be overridden by switch."
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ int main(const int argc, const char* const* const argv)
|
||||
metrics->set_send_metrics(*p);
|
||||
}
|
||||
|
||||
if (args.send_metrics.value_or(true) && !metrics->metrics_enabled())
|
||||
if (args.send_metrics.value_or(false) && !metrics->metrics_enabled())
|
||||
{
|
||||
System::print2(System::Color::warning, "Warning: passed --sendmetrics, but metrics are disabled.\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user