Last active
August 29, 2015 14:05
-
-
Save nadoneves/6aabd77b3c6433c14861 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 readline = require('readline'); | |
// Criando objeto que instacia a pergunta | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
var r; | |
// Perguntando ao usuário qual o tipo do e-mail | |
rl.question("Qual o tipo do e-mail? Ex.: cameba, eletronicos, etc...", function(resposta) { | |
r = true; | |
/* | |
// Lendo o arquivo base para gerar o novo arquivo | |
fs.readFile('boilerplate.html', function (err, data) { | |
if (err) throw err; | |
// Gerando o novo arquivo | |
fs.writeFile('output/'+dia+ '-' + mes + '-' + ano + '-' + resposta +'.html', data, function(){ | |
if (err) throw err; | |
}); | |
}); | |
*/ | |
if(r) | |
{ | |
// Perguntando ao usuário qual o tipo do e-mail | |
rl.question("New Question...", function(resposta) { | |
/* | |
// Lendo o arquivo base para gerar o novo arquivo | |
fs.readFile('boilerplate.html', function (err, data) { | |
if (err) throw err; | |
// Gerando o novo arquivo | |
fs.writeFile('output/'+dia+ '-' + mes + '-' + ano + '-' + resposta +'.html', data, function(){ | |
if (err) throw err; | |
}); | |
}); | |
*/ | |
rl.close(); | |
process.stdin.destroy(); | |
}); | |
} | |
else | |
{ | |
rl.close(); | |
process.stdin.destroy(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment