diff --git a/src/pfe/portal/modules/utils/sharedFunctions.js b/src/pfe/portal/modules/utils/sharedFunctions.js index 65c260375..ecec8a683 100644 --- a/src/pfe/portal/modules/utils/sharedFunctions.js +++ b/src/pfe/portal/modules/utils/sharedFunctions.js @@ -85,9 +85,9 @@ module.exports.updateObject = function updateObject(objectToUpdate, fieldsToAddT return objectToUpdate; } -module.exports.copyProject = async function copyFile(fromProjectPath, toProjectPath, mode) { +module.exports.copyProject = async function copyFile(fromProjectPath, toProjectPath, mode, preserve = false) { log.debug(`copyProject fromPath: ${fromProjectPath}, toPath: ${toProjectPath}`); - await fs.copy(fromProjectPath, toProjectPath, { preserveTimestamps: true }); + await fs.copy(fromProjectPath, toProjectPath, { preserveTimestamps: preserve }); if (mode) { await fs.chmod(toProjectPath, mode); } diff --git a/src/pfe/portal/routes/projects/remoteBind.route.js b/src/pfe/portal/routes/projects/remoteBind.route.js index 1b2456c59..3a124feea 100644 --- a/src/pfe/portal/routes/projects/remoteBind.route.js +++ b/src/pfe/portal/routes/projects/remoteBind.route.js @@ -266,7 +266,7 @@ async function uploadEnd(req, res) { || modifiedList.length > 0; if (wasProjectChanged) { const projectPath = project.projectPath(); - await cwUtils.copyProject(pathToTempProj, projectPath, getMode(project)); + await cwUtils.copyProject(pathToTempProj, projectPath, getMode(project), true); if (project.injectMetrics) { try {