2025-10-26 15:23:56 +00:00
|
|
|
import * as plugins from './mod.plugins.ts';
|
|
|
|
|
import * as paths from '../szci.paths.ts';
|
2025-12-14 01:42:14 +00:00
|
|
|
import { logger } from '../szci.logging.ts';
|
2016-06-26 04:54:10 +02:00
|
|
|
|
|
|
|
|
/**
|
2025-12-14 01:42:14 +00:00
|
|
|
* Cleans szci config files from the project directory
|
2016-06-26 04:54:10 +02:00
|
|
|
*/
|
2025-12-14 01:42:14 +00:00
|
|
|
export const clean = async (): Promise<void> => {
|
|
|
|
|
try {
|
|
|
|
|
if (plugins.smartfile.fs.fileExistsSync(paths.SzciPackageConfig)) {
|
|
|
|
|
plugins.smartfile.fs.removeSync(paths.SzciPackageConfig);
|
|
|
|
|
logger.log('ok', 'Cleaned szci config files');
|
|
|
|
|
} else {
|
|
|
|
|
logger.log('info', 'No szci config files to clean');
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.log('error', `Failed to clean config files: ${(error as Error).message}`);
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
2018-04-04 22:25:13 +02:00
|
|
|
};
|