Skip to content

Commit dee662d

Browse files
committed
feat(cli): add user command
1 parent b708b80 commit dee662d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

addons/cli/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"Print help information#!cli.description.help": "打印帮助信息",
77
"[command]#!cli.usage.help": "[命令]",
88
"Print version information#!cli.description.version": "打印版本信息",
9+
"Print user data path#!cli.description.user": "打印用户数据路径",
910
"Run a command with arguments in a new tab#!cli.description.run": "在新标签页执行带参数的命令",
1011
"Open built-in tab#!cli.description.open": "打开内置标签页",
1112
"<name>#!cli.usage.open": "<名称>",

addons/cli/src/main/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ ${
174174
},
175175
})
176176

177+
commas.context.provide('cli.command', {
178+
command: 'user',
179+
description: 'Print user data path#!cli.description.user',
180+
handler() {
181+
return commas.file.userFile()
182+
},
183+
})
184+
177185
commas.context.provide('cli.command', {
178186
command: 'run',
179187
description: 'Run a command with arguments in a new tab#!cli.description.run',

0 commit comments

Comments
 (0)