Skip to content

Commit

Permalink
update:优化page命令.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvkens committed Oct 18, 2016
1 parent 1f2b392 commit 94573f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#1.4.0

+ uba新的架构调整.
+ uba新的架构调整,本地端->远程端的模式来加载.
+ 增加在线最佳实践浏览命令 `uba list`.
+ 创建单独[uba-templates](https://github.com/uba-templates)仓库用于存放最佳实践模板.
* 修改初始化命令参数 `uba init iuap name` (iuap最佳实践名称是通过uba list所查询得到).
Expand Down
10 changes: 1 addition & 9 deletions bin/uba.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,8 @@ switch (commands[0]) {
publish();
break;
case 'page':
var name = null;
if (commands[1]) {
name = commands[1];
} else {
// help.help();
help.error('命令不正确!\n语法:uba page name');
process.exit(1);
}
const page = require('../lib/page');
page(name);
page(commands);
break;
default:
help.error('命令不正确!\n语法:uba --help');
Expand Down
9 changes: 8 additions & 1 deletion lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ const pathExists = require('path-exists');
const fileLists = ['index.css', 'index.html', 'index.js', 'index.less'];
var copyUrl = '',
rootUrl = path.resolve('.', './src/containers/temp');
module.exports = (name) => {
module.exports = (commands) => {
var name = null;
if (commands[1]) {
name = commands[1];
} else {
help.error('命令不正确!\n语法:uba page name');
process.exit(1);
}
if (!pathExists.sync(rootUrl)) {
help.error("没有找到page模板");
process.exit(1);
Expand Down

0 comments on commit 94573f2

Please sign in to comment.