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

Unbreak default ints in text input #5118

Merged
merged 6 commits into from Oct 13, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
- Fixes a crash in integer params when a default value is selected in the prompt. (#5118)
5 changes: 4 additions & 1 deletion src/deploy/functions/params.ts
Expand Up @@ -605,7 +605,10 @@ async function promptText<T extends RawParamValue>(
return promptText<T>(prompt, input, resolvedDefault, converter);
}
}
const converted = converter(res);
// TODO(vsfan): the toString() is because PromptOnce()'s return type of string
// is wrong--it will return the type of the default if selected. Remove this
// hack once we fix the prompt.ts metaprogramming.
const converted = converter(res.toString());
if (typeof converted === "object") {
logger.error(converted.message);
return promptText<T>(prompt, input, resolvedDefault, converter);
Expand Down