Created
June 23, 2018 09:07
-
-
Save GeradeDev/fd05ce264b9db839b6ef154a45ed97a7 to your computer and use it in GitHub Desktop.
node project generator
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 fs = require('fs-extra'); | |
module.exports = { | |
generate: function (template, projectName){ | |
fs.mkdirs('./' + projectName + '', function (error) { | |
if(error) | |
console.log(error); | |
else{ | |
var templateToCopy = __dirname + "/templates/" + template; | |
var projDir = './' + projectName; | |
fs.copy(templateToCopy, projDir, function (err) { | |
if (err) { | |
console.error(err) | |
} else { | |
console.log('success!!!!!!!!!!!!'); | |
} | |
}); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment