mirror of
https://github.com/NinjaSurge/Project-Manager.git
synced 2026-05-01 12:29:02 -05:00
server side clean-up
This commit is contained in:
@@ -82,41 +82,8 @@ const getProject = (project_directory, id) => {
|
||||
return project;
|
||||
};
|
||||
|
||||
// /**
|
||||
// * @description Returns a file from the project directory
|
||||
// * @author NinjaSurge
|
||||
// * @param {*} project_directory - The directory containing all the projects
|
||||
// * @param {*} id - The id of the project to be returned
|
||||
// * @param {String} filePath - The file path within the project directory to return
|
||||
// * @return {*} File Data
|
||||
// */
|
||||
// const getProjectFile = (project_directory, id, filePath) => {
|
||||
// checkFS(project_directory);
|
||||
// listProjects(project_directory);
|
||||
|
||||
// console.log(filePath);
|
||||
|
||||
// let projectFile = null;
|
||||
|
||||
// if (!validate(id)) throw new Error('Unable to validate id');
|
||||
// projectsList.forEach((p) => {
|
||||
// if (p._id === id) {
|
||||
// if (fs.existsSync(`${project_directory}/${p.name}/${filePath}`)) {
|
||||
// return (projectFile = fs.readFileSync(
|
||||
// `${project_directory}/${p.name}/${filePath}`
|
||||
// ));
|
||||
// } else {
|
||||
// // console.log(err);
|
||||
// throw new Error('Unable to get file from this directory');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// // console.log(projectFile);
|
||||
// return projectFile;
|
||||
// };
|
||||
|
||||
/**
|
||||
* @description Returns a file location from the project directory
|
||||
* @description Returns a relative file location from the project directory
|
||||
* @author NinjaSurge
|
||||
* @param {*} project_directory - The directory containing all the projects
|
||||
* @param {*} id - The id of the project to be returned
|
||||
|
||||
Reference in New Issue
Block a user