Skip to content

Commit

Permalink
Feat: 1.4.13 change
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaoh committed Apr 12, 2024
1 parent 6c736f2 commit 07e32af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
25 changes: 7 additions & 18 deletions bin/xcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: HxB
* @Date: 2022-04-25 16:27:06
* @LastEditors: DoubleAm
* @LastEditTime: 2024-04-12 22:18:51
* @LastEditTime: 2024-04-12 22:43:01
* @Description: 命令处理文件
* @FilePath: \js-xcmd\bin\xcmd.js
*/
Expand Down Expand Up @@ -391,25 +391,14 @@ program
.option('ig', 'ig')
.command('ig')
.action(() => {
let cmdStr = 'npm i nrm pnpm cnpm js-xcmd nodemon pm2 yarn rimraf protobufjs protobufjs-cli -g';
let cmdStr =
'npm i nrm pnpm cnpm js-xcmd nodemon pm2 yarn rimraf protobufjs protobufjs-cli create-react-app @vue/cli @angular/cli cordova -g';
console.log({ cmdStr });

const cmdProcess = nodeCmd.get(cmdStr);

cmdProcess.stdout.on('data', (data) => {
nodeCmd.run(cmdStr, (err, data, stderr) => {
console.log(stderr);
if (err) return console.log(`%c出错啦!${data}`, 'color:red;');
console.log(data);
});

cmdProcess.stderr.on('data', (data) => {
console.error(data);
});

cmdProcess.on('close', (code) => {
if (code === 0) {
console.log('----------Successful----------');
} else {
console.log(`%c出错啦!退出码: ${code}`, 'color:red;');
}
console.log('----------Successful----------');
});
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-xcmd",
"version": "1.4.12",
"version": "1.4.13",
"description": "XCmd library for node.js.",
"main": "main.js",
"bin": {
Expand Down

0 comments on commit 07e32af

Please sign in to comment.