hardhat
Version:
Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.
25 lines • 912 B
JavaScript
import { isTelemetryAllowed, setTelemetryEnabled, } from "../../cli/telemetry/telemetry-permissions.js";
const configureTelemetry = async ({ enable, disable }) => {
if (enable && disable) {
console.error("Cannot enable and disable telemetry at the same time");
process.exitCode = 1;
return;
}
if (enable) {
console.log("Enabling telemetry...");
await setTelemetryEnabled(true);
}
if (disable) {
console.log("Disabling telemetry...");
await setTelemetryEnabled(false);
}
const consent = await isTelemetryAllowed();
if (consent) {
console.log("Telemetry is enabled, to disable it run `npx hardhat telemetry --disable`");
}
else {
console.log("Telemetry is disabled, to enable it run `npx hardhat telemetry --enable`");
}
};
export default configureTelemetry;
//# sourceMappingURL=task-action.js.map