Skip to content

Commit

Permalink
Feat: add runSync log
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaoh committed Apr 12, 2024
1 parent b798e62 commit 7e1ea61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions bin/xcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,11 @@ program
.action(() => {
let cmdStr = 'npm i nrm pnpm cnpm js-xcmd nodemon pm2 yarn rimraf protobufjs protobufjs-cli -g';
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
console.log(stderr);
if (err) return console.log(`%c出错啦!${data}`, 'color:red;');
console.log(data);
console.log('----------Successful----------');
});
const result = nodeCmd.runSync(cmdStr);
console.log(result.stderr);
if (result.err) return console.log(`%c出错啦!${result.data}`, 'color:red;');
console.log(result.data);
console.log('----------Successful----------');
});

program
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.10",
"version": "1.4.11",
"description": "XCmd library for node.js.",
"main": "main.js",
"bin": {
Expand Down

0 comments on commit 7e1ea61

Please sign in to comment.