Initial commit
This commit is contained in:
25
node_modules/astro/dist/cli/info/infra/prompts-prompt.js
generated
vendored
Normal file
25
node_modules/astro/dist/cli/info/infra/prompts-prompt.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import prompts from "prompts";
|
||||
class PromptsPrompt {
|
||||
#force;
|
||||
constructor({ force }) {
|
||||
this.#force = force;
|
||||
}
|
||||
async confirm({
|
||||
message,
|
||||
defaultValue
|
||||
}) {
|
||||
if (this.#force) {
|
||||
return true;
|
||||
}
|
||||
const { value } = await prompts({
|
||||
type: "confirm",
|
||||
name: "value",
|
||||
message,
|
||||
initial: defaultValue
|
||||
});
|
||||
return value;
|
||||
}
|
||||
}
|
||||
export {
|
||||
PromptsPrompt
|
||||
};
|
||||
Reference in New Issue
Block a user