INNER CODE UNIT · TypeScript
cleanCache
Serverless-Devs/Serverless-Devs · src/command/clean/index.ts:29
function cleanCache(cache: string | boolean) {
const sPath = getRootHome();
const cachePath = path.join(sPath, 'cache');
// cache 无参数
if (cache === true) {
rimraf.sync(cachePath);
logger.info('Cache cleaned up successfully.');
return;
}
// cache 有参数
rimraf.sync(path.join(cachePath, cache as string));
logger.info(`Cache [${cache}] has been cleaned up successfully.`);
}
function cleanComponent(component: string | boolean) {
const sPath = getRootHome();
const componentsPath = path.join(sPath, 'components');