Skip to content

Instantly share code, notes, and snippets.

@muZk
Last active December 12, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muZk/4773377 to your computer and use it in GitHub Desktop.
Save muZk/4773377 to your computer and use it in GitHub Desktop.
function createDirectory(path){
return function(callback){
mkpath(path,function(err){
callback(null,path)
});
};
}
exports.album_create = function(req,res){
var album_path = "uploads/albums/"+req.body.name
async.series({
album: createDirectory(album_path),
pages: createDirectory(album_path+"/pages"),
laminas: createDirectory(album_path+"/laminas"),
sobres: createDirectory(album_path+"/sobres")
},
function(err, results) {
res.redirect('/admin/album');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment