refactor: rename project

This commit is contained in:
Carlos Valente
2024-06-27 22:36:51 +02:00
committed by Carlos Valente
parent c9ef8d55c1
commit 46195fc043
8 changed files with 58 additions and 64 deletions
@@ -59,35 +59,6 @@ export function doesProjectExist(name: string): boolean {
return existsSync(projectFilePath);
}
/**
* @description Validates the existence of project files.
* @param {object} projectFiles
* @param {string} projectFiles.projectFilename
* @param {string} projectFiles.newFilename
*
* @returns {Promise<Array<string>>} Array of errors
*
*/
export const validateProjectFiles = (projectFiles: { filename?: string; newFilename?: string }): Array<string> => {
const errors: string[] = [];
// current project must exist
if (projectFiles.filename) {
if (!doesProjectExist(projectFiles.filename)) {
errors.push('Project file does not exist');
}
}
// new project must NOT exist
if (projectFiles.newFilename) {
if (doesProjectExist(projectFiles.newFilename)) {
errors.push('New project file already exists');
}
}
return errors;
};
/**
* Returns the absolute path to a project file
*/