Revert "Add error handling in mkdir_p"

This reverts commit c2458cd19018fe05199ce3b33fd4e9230d1cf319.

Apparently mkdirp needs errors to be ignored to work...
This commit is contained in:
James Allen 2016-03-23 15:33:01 +00:00
parent 4d0fe3bf5d
commit 3fe0674462

View file

@ -242,7 +242,6 @@ module.exports = ProjectEntityHandler =
return folder.length != 0
ProjectGetter.getProjectWithOnlyFolders project_id, (err, project)=>
return callback(err) if err?
if path == '/'
logger.log project_id: project._id, "mkdir is only trying to make path of / so sending back root folder"
return callback(null, [], project.rootFolder[0])
@ -256,11 +255,9 @@ module.exports = ProjectEntityHandler =
parentFolder_id = parentFolder._id
builtUpPath = "#{builtUpPath}/#{folderName}"
projectLocator.findElementByPath project, builtUpPath, (err, foundFolder)=>
return callback(err) if err?
if !foundFolder?
logger.log path:path, project_id:project._id, folderName:folderName, "making folder from mkdirp"
@addFolder project_id, parentFolder_id, folderName, (err, newFolder, parentFolder_id)->
return callback(err) if err?
newFolder.parentFolder_id = parentFolder_id
previousFolders.push newFolder
callback null, previousFolders