Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
i18-cli
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马旭烽
i18-cli
Commits
22456237
Commit
22456237
authored
Jun 26, 2023
by
马旭烽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 修复 commander 子命令错误
原逻辑一个 program 只能具备一个 action 导致逻辑被覆盖
parent
058def7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
commanderUtli.ts
package/src/utils/commanderUtli.ts
+6
-1
No files found.
package/src/utils/commanderUtli.ts
View file @
22456237
...
...
@@ -6,5 +6,9 @@ export interface useProgramType<CTX> {
/** 注册程序执行函数 */
export
const
registerUseProgram
=<
CTX
>
(
program
:
Command
,
usePrograms
:
useProgramType
<
CTX
>
[],
ctx
:
CTX
):
Command
=>
{
return
usePrograms
.
reduce
((
program
,
useProgram
)
=>
useProgram
(
program
,
ctx
),
program
);
return
usePrograms
.
reduce
((
program
,
useProgram
,
id
)
=>
{
const
command
=
new
Command
(
'server'
+
id
);
program
.
addCommand
(
useProgram
(
command
,
ctx
));
return
program
;
},
program
);
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment