From: anthony Date: Thu, 14 Jun 2018 01:57:00 +0000 (-0400) Subject: checking if module is in the php modules or sass init file X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=516212be4e45a3ba6e8f6c0cc529aaba03888640;p=WP-Themes%2FglmOrigin.git checking if module is in the php modules or sass init file --- diff --git a/setup/index.html b/setup/index.html index 6cd61ee..82184cc 100644 --- a/setup/index.html +++ b/setup/index.html @@ -10,6 +10,7 @@

GLM Origin Theme Setup

+
some modules may not be displayed (header, footer, front page etc.)
diff --git a/setup/moduleLib.js b/setup/moduleLib.js index 641ea4e..3c267de 100644 --- a/setup/moduleLib.js +++ b/setup/moduleLib.js @@ -1,8 +1,10 @@ const modLib = (function() { - let appState = {}; - let fs = require('fs'); - let path = require('path'); - let reader = require('readline'); + let appState = {}; + let fs = require('fs'); + let path = require('path'); + let reader = require('readline'); + let acceptedToken = ['//', '@import', 'require_once', 'include']; + let excludeMod = ['defaults', 'footer', 'header', 'front-page']; return { @@ -11,11 +13,17 @@ const modLib = (function() { input: fs.createReadStream(filePath) }); }, - + checkLine: function(line, mod){ + for (var i = 0; i < acceptedToken.length; i++) { + if (line.startsWith(acceptedToken[i]) && (line.indexOf(`${mod.name}"`) > -1 || line.indexOf(`${mod.name}.php`) > -1) ){ + console.log(line) + break; + } + } + }, editFile: function(reader,mod){ reader.on("line",function(line){ - - console.log(line) + modLib.checkLine(line, mod) }) }, @@ -73,15 +81,25 @@ const modLib = (function() { $(`

${modType}

`).appendTo( $("#module-list-container")); $(`