prettify
This commit is contained in:
parent
3e2052928d
commit
08cfaf49b1
1 changed files with 14 additions and 11 deletions
|
|
@ -10,16 +10,19 @@ const LIB = path.join(ROOT, 'src/components');
|
|||
const TEMPLATE = path.join(__dirname, 'template');
|
||||
|
||||
const makeNewComponent = async () => {
|
||||
const { name, folder } = await prompts([{
|
||||
type: 'text',
|
||||
name: 'name',
|
||||
message: 'What should we call your new component, e.g., ImagePack?',
|
||||
}, {
|
||||
type: 'text',
|
||||
name: 'folder',
|
||||
message: 'What folder should we put it in, e.g., Graphics?',
|
||||
initial: 'Graphics',
|
||||
}]);
|
||||
const { name, folder } = await prompts([
|
||||
{
|
||||
type: 'text',
|
||||
name: 'name',
|
||||
message: 'What should we call your new component, e.g., ImagePack?',
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'folder',
|
||||
message: 'What folder should we put it in, e.g., Graphics?',
|
||||
initial: 'Graphics',
|
||||
},
|
||||
]);
|
||||
|
||||
if (!name || !folder) return;
|
||||
|
||||
|
|
@ -43,7 +46,7 @@ const makeNewComponent = async () => {
|
|||
LIB,
|
||||
file.replace(/YourComponent/g, componentName)
|
||||
);
|
||||
|
||||
|
||||
fs.ensureDirSync(path.dirname(writePath));
|
||||
|
||||
if (path.extname(file) === '.jpg') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue