mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
[Bug] Fix the error that occurs when executing clear on an empty warehouse (#16507)
Fix the error that occurs when executing clear on an empty warehouse
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const readline = require('readline');
|
||||
const { magenta } = require('chalk');
|
||||
|
||||
let magenta;
|
||||
try {
|
||||
magenta = require('chalk').magenta;
|
||||
} catch (error) {
|
||||
magenta = (str) => str;
|
||||
}
|
||||
|
||||
const prefix = ''.padStart(20, '=');
|
||||
console.log(magenta(`${prefix} Clear cache ${prefix}`));
|
||||
|
||||
Reference in New Issue
Block a user