mirror of
https://github.com/strapi/strapi.git
synced 2025-09-14 11:08:35 +00:00
28 lines
578 B
JavaScript
28 lines
578 B
JavaScript
'use strict';
|
|
|
|
const inquirer = require('inquirer');
|
|
|
|
const getAttributes = async (attributes = []) => {
|
|
const prompts = [
|
|
{
|
|
type: 'input',
|
|
name: 'inputValue',
|
|
message: 'Enter some input: ',
|
|
},
|
|
{
|
|
type: 'confirm',
|
|
name: 'again',
|
|
message: 'Enter another input? ',
|
|
default: true,
|
|
},
|
|
];
|
|
|
|
// eslint-disable-next-line
|
|
const { again, ...answers } = await inquirer.prompt(prompts);
|
|
|
|
const newInputs = [...attributes, answers];
|
|
return again ? getAttributes(newInputs) : newInputs;
|
|
};
|
|
|
|
module.exports = getAttributes;
|