添加 kit 子目录
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
*
|
||||
* child_process
|
||||
* - exec 适合短时间命令,获取完整输出
|
||||
* - execFile 适合实时交互
|
||||
* - spawn 适合长时间命令
|
||||
*
|
||||
* shelljs - https://www.npmjs.com/package/shelljs
|
||||
* execa - https://www.npmjs.com/package/execa
|
||||
* ssh2 - https://www.npmjs.com/package/ssh2
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
execSync(cmd){
|
||||
$logger.debug(`execSync ${cmd}`)
|
||||
const output = execSync(cmd);
|
||||
return output.toString()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user