1
0

2 Коміти c9665a5e69 ... 04df9cf180

Автор SHA1 Опис Дата
  Lee Morgan 04df9cf180 Bug fix: Deleting previous temp files was failing. 3 днів тому
  Lee Morgan 1739370e34 Change the main tags for neovan files. 3 днів тому
2 змінених файлів з 6 додано та 6 видалено
  1. 1 1
      index.js
  2. 5 5
      parseComponent.js

+ 1 - 1
index.js

@@ -75,7 +75,7 @@ const removeOldTmpDirs = async ()=>{
     const entries = await fs.readdir(os.tmpdir());
     for(let i = 0; i < entries.length; i++){
         if(entries[i].startsWith("neovan-")){
-            fs.rm(entries[i].name, {recursive: true, force: true});
+            fs.rm(entries[i], {recursive: true, force: true});
         }
     }
 }

+ 5 - 5
parseComponent.js

@@ -22,16 +22,16 @@ const getNeovanData = async (index)=>{
     const neovan = await fs.readFile(index, "utf-8");
     const parentPath = path.dirname(index);
     
-    const html = neovan.slice(neovan.indexOf("<contents>") + 10, neovan.indexOf("</contents>"));
+    const html = neovan.slice(neovan.indexOf("<@html>") + 11, neovan.indexOf("<@/html>"));
     let css = "";
     let js = "";
-    const cssIndex = neovan.indexOf("<style>");
+    const cssIndex = neovan.indexOf("<@style>");
     if(cssIndex >= 0){
-        css = neovan.slice(cssIndex + 7, neovan.indexOf("</style>"));
+        css = neovan.slice(cssIndex + 8, neovan.indexOf("<@/style>"));
     }
-    const jsIndex = neovan.indexOf("<script>")
+    const jsIndex = neovan.indexOf("<@script>")
     if(jsIndex >= 0){
-        js = neovan.slice(jsIndex + 8, neovan.indexOf("</script>"));
+        js = neovan.slice(jsIndex + 9, neovan.indexOf("<@/script>"));
     }
 
     const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "neovan-"));