Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MuyianKing committed Dec 16, 2024
1 parent 2caadf2 commit be4234c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

<p align="center">
<a href="https://www.npmjs.com/package/@muyianking/cli" style="text-decoration: none;"><img src="https://img.shields.io/npm/v/%40muyianking%2Fcli"/></a>
<a href="https://nodejs.org/en/about/previous-releases" style="text-decoration: none;"><img src="https://img.shields.io/npm/l/%40muyianking%2Fcli"/></a>
<a href="https://github.com/vitejs/vite/actions/workflows/ci.yml" style="text-decoration: none;"><img src="https://img.shields.io/npm/dm/%40muyianking%2Fcli"/></a>
<a href="https://www.npmjs.com/package/@muyianking/cli" style="text-decoration: none;"><img src="https://img.shields.io/npm/l/%40muyianking%2Fcli"/></a>
<a href="https://www.npmjs.com/package/@muyianking/cli" style="text-decoration: none;"><img src="https://img.shields.io/npm/dm/%40muyianking%2Fcli"/></a>
</p>


## Install

```bash
Expand All @@ -37,7 +36,7 @@ mu h5
mu html
```

## 贡献者
## Contributors

<!-- readme: collaborators,contributors -start -->
<table>
Expand Down
18 changes: 11 additions & 7 deletions core/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions core/bin/utils/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,15 @@ 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('\\'))
},
})

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]}`)
Expand Down

0 comments on commit be4234c

Please sign in to comment.