mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
handle rt files
This commit is contained in:
parent
fb5a77bdec
commit
913f4ded0c
@ -14,8 +14,8 @@ if (process.argv.length > 2) {
|
||||
}
|
||||
|
||||
function handleSingleFile(filename) {
|
||||
if (path.extname(filename) !== ".html") {
|
||||
console.log('invalid file, only handle html files');
|
||||
if (path.extname(filename) !== ".rt") {
|
||||
console.log('invalid file, only handle rt files');
|
||||
return;// only handle html files
|
||||
}
|
||||
var html = fs.readFileSync(filename).toString();
|
||||
@ -24,5 +24,5 @@ function handleSingleFile(filename) {
|
||||
return;
|
||||
}
|
||||
var js = reactTemplates.convertTemplateToReact(html);
|
||||
fs.writeFileSync(filename.replace(".html", ".js"), js);
|
||||
fs.writeFileSync(filename + '.js', js);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user