[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:
SijieWang
2023-11-14 16:31:43 +08:00
committed by GitHub
parent c41807c4f6
commit 409b540b80
+7 -1
View File
@@ -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}`));