| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a5ab23e commit 54c96c8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,12 +33,16 @@ process.chdir(path.join(scriptDir, '..')); | |||
| 33 | 33 | ||
| 34 | 34 | const originalConsole = { ...console }; | |
| 35 | 35 | console.warn = function (...args) { | |
| 36 | - const [m, ...rest] = args; | ||
| 37 | - originalConsole.warn(styleText(['yellow'], m), ...rest); | ||
| 36 | + if (typeof args[0] === 'string') { | ||
| 37 | + args[0] = styleText(['yellow'], args[0]); | ||
| 38 | + } | ||
| 39 | + originalConsole.warn(...args); | ||
| 38 | 40 | }; | |
| 39 | 41 | console.error = function (...args) { | |
| 40 | - const [m, ...rest] = args; | ||
| 41 | - originalConsole.error(styleText(['red'], m), ...rest); | ||
| 42 | + if (typeof args[0] === 'string') { | ||
| 43 | + args[0] = styleText(['red'], args[0]); | ||
| 44 | + } | ||
| 45 | + originalConsole.error(...args); | ||
| 42 | 46 | }; | |
| 43 | 47 | ||
| 44 | 48 | try { | |
@@ -47,6 +51,6 @@ try { | |||
| 47 | 51 | process.exitCode = typeof exitCode === 'number' ? exitCode : 0; | |
| 48 | 52 | // eslint-disable-next-line @typescript-eslint/no-explicit-any | |
| 49 | 53 | } catch (err: any) { | |
| 50 | - console.error(err.stack); | ||
| 54 | + console.error(err.stack ?? err); | ||
| 51 | 55 | process.exitCode = 99; | |
| 52 | 56 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments