hardhat
Version:
Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.
26 lines • 1 kB
JavaScript
import { errorResult, successfulResult } from "../../../utils/result.js";
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");
return errorResult();
}
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`");
}
return successfulResult();
};
export default configureTelemetry;
//# sourceMappingURL=task-action.js.map