hdw2
Version:
鸿蒙前端hdc调试工具
24 lines (20 loc) • 702 B
JavaScript
/*
* @Author: tankunpeng
* @Date: 2024-06-26 19:47:35
* @LastEditTime: 2025-08-06 16:10:04
* @LastEditors: tankunpeng
* @Description: 执行hdc shell命令
* Come on, worker!
*/
const child_process = require('child_process');
const { getHdc, printTitle, shellLog } = require('./util');
const chalk = require('chalk');
function hdcShell(options = {}, command = {}, logOps = {}) {
const hdc = getHdc();
printTitle('=====>执行hdc shell命令<=====', logOps, { beforeLine: true, afterLine: true });
shellLog(`${chalk.cyan('hdc命令输出:')}`, logOps);
child_process.spawnSync(hdc, ['shell', ...command.args], {
stdio: 'inherit',
});
}
exports.hdcShell = hdcShell;