handle rt files
This commit is contained in:
parent
fb5a77bdec
commit
913f4ded0c
|
@ -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);
|
||||||
}
|
}
|
Loading…
Reference in New Issue