handle rt files

This commit is contained in:
ido 2014-11-10 19:15:58 +02:00
parent fb5a77bdec
commit 913f4ded0c
1 changed files with 3 additions and 3 deletions

View File

@ -14,8 +14,8 @@ if (process.argv.length > 2) {
} }
function handleSingleFile(filename) { function handleSingleFile(filename) {
if (path.extname(filename) !== ".html") { if (path.extname(filename) !== ".rt") {
console.log('invalid file, only handle html files'); console.log('invalid file, only handle rt files');
return;// only handle html files return;// only handle html files
} }
var html = fs.readFileSync(filename).toString(); var html = fs.readFileSync(filename).toString();
@ -24,5 +24,5 @@ function handleSingleFile(filename) {
return; return;
} }
var js = reactTemplates.convertTemplateToReact(html); var js = reactTemplates.convertTemplateToReact(html);
fs.writeFileSync(filename.replace(".html", ".js"), js); fs.writeFileSync(filename + '.js', js);
} }