@myassis/gateway 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -37,8 +37,16 @@ CORS 管理命令:
|
|
|
37
37
|
其他:
|
|
38
38
|
--version, -v 显示版本号
|
|
39
39
|
--help, -h 显示本帮助信息
|
|
40
|
+
--verbose 显示运行时详细日志
|
|
40
41
|
`);
|
|
41
42
|
process.exit(0);
|
|
42
43
|
}
|
|
44
|
+
// 静默模式:非启动服务类命令(install/uninstall/status/start/stop/restart/update)
|
|
45
|
+
// 默认静默日志,除非传 --verbose
|
|
46
|
+
const quietCommands = ['install', 'uninstall', 'status', 'start', 'stop', 'restart', 'update'];
|
|
47
|
+
const command = args.find(a => !a.startsWith('-'));
|
|
48
|
+
if (command && quietCommands.includes(command) && !args.includes('--verbose')) {
|
|
49
|
+
process.env.LOG_LEVEL = 'error';
|
|
50
|
+
}
|
|
43
51
|
// 需要加载模块的命令,导入主程序
|
|
44
52
|
import('./main.js');
|