Skip to content

Commit

Permalink
Feat: 增加模板选项
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaoh committed Jun 15, 2023
1 parent d5687c2 commit 19049c7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions bin/xcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: HxB
* @Date: 2022-04-25 16:27:06
* @LastEditors: DoubleAm
* @LastEditTime: 2023-05-19 14:46:10
* @LastEditTime: 2023-06-15 14:34:01
* @Description: 命令处理文件
* @FilePath: \js-xcmd\bin\xcmd.js
*/
Expand Down Expand Up @@ -97,14 +97,25 @@ program
});

program
.option('create-web-base [dir]', 'create web-base cli')
.command('create-web-base [dir]')
.action((dir) => {
.option('create-web-base [dir] [branch]', 'create web-base cli')
.command('create-web-base [dir] [branch]')
.action((dir, branch) => {
console.log('----------Clone Template----------');
console.log(logLogo(logo));
download('github:biugle/web_base', !dir ? 'web_base' : dir, function (err) {
console.log(err ? err : '----------Successful----------');
});
const branchs = {
main: 'main',
modules: 'modules',
'c-modules': 'client-modules',
'c-main': 'client-main',
cross: 'simple-cross-platform'
};
download(
'github:biugle/web_base' + branch ? `#${branchs[branch] ?? branch ?? 'main'}` : '',
!dir ? 'web_base' : dir,
function (err) {
console.log(err ? err : '----------Successful----------');
}
);
});

// xcmd copy-file ./package.json ./target/package.json
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-xcmd",
"version": "1.4.0",
"version": "1.4.1",
"description": "XCmd library for node.js.",
"main": "main.js",
"bin": {
Expand Down

0 comments on commit 19049c7

Please sign in to comment.