27 lines
757 B
TypeScript
27 lines
757 B
TypeScript
import * as plugins from './mod.plugins.js';
|
|
import * as paths from '../paths.js';
|
|
|
|
import { logger } from '../gitzone.logging.js';
|
|
import { Project } from '../classes.project.js';
|
|
|
|
const filesToDelete = [
|
|
'defaults.yml',
|
|
'yarn.lock',
|
|
'package-lock.json',
|
|
'tslint.json',
|
|
];
|
|
|
|
export const run = async (projectArg: Project) => {
|
|
for (const relativeFilePath of filesToDelete) {
|
|
const fileExists = await plugins.smartfs.file(relativeFilePath).exists();
|
|
if (fileExists) {
|
|
logger.log('info', `Found ${relativeFilePath}! Removing it!`);
|
|
await plugins.smartfs
|
|
.file(plugins.path.join(paths.cwd, relativeFilePath))
|
|
.delete();
|
|
} else {
|
|
logger.log('info', `Project is free of ${relativeFilePath}`);
|
|
}
|
|
}
|
|
};
|