Skip to content

Commit

Permalink
feat: init 项目可配
Browse files Browse the repository at this point in the history
  • Loading branch information
flyyuan committed Oct 29, 2020
1 parent 33305f2 commit b6735a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/emp-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 指令

+ `emp init 项目名` 新建项目
+ `emp init 框架名 项目名` 新建项目,当前框架可选 React
+ `emp dev` 调试
+ `emp dev --hot` 热更
+ `emp dev --open` 打开调试页面
Expand Down
6 changes: 3 additions & 3 deletions packages/emp-cli/bin/emp.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ program

//初始化项目
program
.command('init <projectName>')
.command('init <framework> <projectName>')
.description('初始化 emp 项目')
.action(projectName => {
.action((framework,projectName) => {
require('../helpers/downloadRepo')(
'https://git.yy.com/webs/efox/template/emp-react-template.git',
require('../init.json')[framework],
`./${projectName}`,
'',
)
Expand Down
3 changes: 3 additions & 0 deletions packages/emp-cli/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"react": "https://github.com/efoxTeam/emp-react-template.git"
}

0 comments on commit b6735a1

Please sign in to comment.