Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: propagate abort during telemetry consent enquiry #5966

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions v-next/hardhat/src/internal/cli/prompt/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ export async function confirmationPromptWithTimeout(
}

return result;
} catch (e) {
if (e === "") {
// If the user cancels the prompt, we quit
return undefined;
}

throw e;
} finally {
// We can always clear the timeout, even if not set, this API is safe to
// call with invalid values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ async function getTelemetryConsent(telemetryConsentFilePath?: string) {

if (await exists(telemetryConsentFilePath)) {
// Telemetry consent was already provided, hence return the answer
return (await readJsonFile<TelemetryConsent>(telemetryConsentFilePath))
.consent;
const consent = (
await readJsonFile<TelemetryConsent>(telemetryConsentFilePath)
).consent;

log(`Telemetry consent value: ${consent}`);

return consent;
}

log("No telemetry consent file found");

return undefined;
}

Expand Down