Created
August 16, 2012 18:14
-
-
Save tbergeron/3372274 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var directories = [ | |
'./app', | |
'./app/controllers', | |
'./app/helpers', | |
'./app/repositories', | |
'./app/validations', | |
'./app/views', | |
'./app/views/partials' | |
] | |
createDirectories(directories, function(result) { | |
if (result) { | |
writeBasicAppFiles(function() { | |
console.warn('New ThinAir has been created successfully!') | |
}) | |
} | |
}) | |
function createDirectories(list, callback) { | |
async.map(list, createDirectory, function(err, results) { | |
callback(true) | |
}) | |
function createDirectory(name) { | |
fs.mkdir('./app', 0755, function(e) { | |
if (e) { | |
console.error('Error while creating', name) | |
callback(false) | |
} else { | |
console.warn(' - Created directory:', name) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment