Skip to content

Commit

Permalink
细节优化
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeRainStarSky committed Apr 1, 2024
1 parent d886581 commit 2f85ce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default class Yunzai extends EventEmitter {
return "[object null]"

return util.inspect(data, {
depth: null,
depth: 10,
colors: true,
showHidden: true,
showProxy: true,
Expand Down Expand Up @@ -367,10 +367,10 @@ export default class Yunzai extends EventEmitter {
req.res.send(file.buffer)
}

async exec(cmd) {
async exec(cmd, opts = {}) {
return new Promise(resolve => {
this.makeLog("mark", `[执行命令] ${logger.blue(cmd)}`)
exec(cmd, (error, stdout, stderr) => {
exec(cmd, opts, (error, stdout, stderr) => {
resolve({ error, stdout, stderr })
this.makeLog("mark", `[执行命令完成] ${logger.blue(cmd)}${stdout?`\n${String(stdout).trim()}`:""}${stderr?logger.red(`\n${String(stderr).trim()}`):""}`)
if (error) this.makeLog("error", `[执行命令错误] ${logger.blue(cmd)}\n${logger.red(this.Loging(error).trim())}`)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"pm2": "^5.3.1",
"puppeteer": "*",
"redis": "^4.6.13",
"sequelize": "^6.37.1",
"sequelize": "^6.37.2",
"sqlite3": "5.1.6",
"ws": "^8.16.0",
"yaml": "^2.4.1"
Expand Down

0 comments on commit 2f85ce5

Please sign in to comment.