From be4234cc27f8e05d804b3ee96e667226632b1d0f Mon Sep 17 00:00:00 2001 From: MuyianKing Date: Mon, 16 Dec 2024 15:34:41 +0800 Subject: [PATCH] update README.md --- README.md | 7 +++---- core/bin/index.js | 18 +++++++++++------- core/bin/utils/download.js | 7 ++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 566c17a..b6803f0 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@

- - + +

- ## Install ```bash @@ -37,7 +36,7 @@ mu h5 mu html ``` -## 贡献者 +## Contributors diff --git a/core/bin/index.js b/core/bin/index.js index 575e3c4..dc06973 100644 --- a/core/bin/index.js +++ b/core/bin/index.js @@ -11,10 +11,14 @@ import inquirerWebPrompt from './command/inquirer.web.js' // 无操作提示 inquirerPrompt() -yargs(hideBin(process.argv)).command('web', '新建一个项目', (argv) => { - inquirerWebPrompt(argv) -}).command('h5', '新建一个项目', (argv) => { - inquirerH5Prompt(argv) -}).command(['html'], '新建一个普通项目', (argv) => { - inquirerHtmlPrompt(argv) -}).argv +yargs(hideBin(process.argv)) + .command('web', '新建一个WEB项目', (argv) => { + inquirerWebPrompt(argv) + }) + .command('h5', '新建一个H5项目', (argv) => { + inquirerH5Prompt(argv) + }) + .command(['html'], '新建一个HTML项目', (argv) => { + inquirerHtmlPrompt(argv) + }) + .argv diff --git a/core/bin/utils/download.js b/core/bin/utils/download.js index cc234c0..478cbc4 100644 --- a/core/bin/utils/download.js +++ b/core/bin/utils/download.js @@ -37,7 +37,7 @@ export default async function (project_name, build_type) { const temp_path = path.join(process.cwd(), project_name) await download(GITHUB_TEMPLATE_URL, temp_path, { // 过滤指定的代码 - filter: (file) => { + filter(file) { return file.path.includes(build_type.join('\\')) }, }) @@ -45,10 +45,7 @@ export default async function (project_name, build_type) { spinner.succeed('downloaded successfully') // 将文件拷贝到项目根目录 - copyDir( - `${temp_path}/${build_type.join('/')}`, - temp_path, - ) + copyDir(`${temp_path}/${build_type.join('/')}`, temp_path) // 删除源文件 removeSync(`${temp_path}/${build_type[0]}`)