update
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
import * as plugins from './mod.plugins.ts';
|
||||
import * as paths from '../szci.paths.ts';
|
||||
import { logger } from '../szci.logging.ts';
|
||||
|
||||
/**
|
||||
* cleans szci config files
|
||||
* Cleans szci config files from the project directory
|
||||
*/
|
||||
export let clean = async (): Promise<void> => {
|
||||
plugins.smartfile.fs.removeSync(paths.SzciPackageConfig);
|
||||
return;
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user