mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
use prompts dep
This commit is contained in:
1 parent
8a1546f9dd
commit
bc838bf0f2
6 files changed
+42
-28
No files matched your search
+19
-12
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import servor from 'servor';
|
||||
import inquirer from 'inquirer';
|
||||
import prompts from 'prompts';
|
||||
import { fileURLToPath } from 'url';
|
||||
import projects from './projects.js';
|
||||
import { Parcel } from '@parcel/core';
|
||||
@@ -62,15 +62,22 @@ async function develop(name) {
|
||||
});
|
||||
}
|
||||
|
||||
inquirer
|
||||
.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
message: 'Which project do you want to develop?',
|
||||
name: 'project',
|
||||
choices: Object.keys(projects),
|
||||
},
|
||||
])
|
||||
.then((answers) => {
|
||||
develop(answers.project);
|
||||
(async () => {
|
||||
const response = await prompts({
|
||||
type: 'select',
|
||||
name: 'value',
|
||||
message: 'Which project do you want to develop?',
|
||||
choices: Object.keys(projects).map((name) => {
|
||||
return {
|
||||
title: name,
|
||||
value: name,
|
||||
description: projects[name],
|
||||
};
|
||||
}),
|
||||
initial: 0,
|
||||
});
|
||||
|
||||
if (response.value) {
|
||||
develop(response.value);
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user