This commit is contained in:
Pez Cuckow
2025-02-26 10:38:27 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -265,7 +265,7 @@ async function loadNodeConfig(fileInfo) {
module: module,
name: name,
file: file,
template: file.replace(/\.js$/,".html"),
template: file.replace(/\.[^.]+$/, '.html'),
enabled: isEnabled,
loaded:false,
version: version,

View File

@@ -72,11 +72,11 @@ function getLocalFile(file) {
return null;
}
try {
fs.statSync(file.replace(/\.js$/,".html"));
fs.statSync(file.replace(/\.[\w]?js$/, '.html'));
return {
file: file,
module: "node-red",
name: path.basename(file).replace(/^\d+-/,"").replace(/\.js$/,""),
name: path.basename(file).replace(/^\d+-/,"").replace(/\.[\w]?js$/,""),
version: settings.version
};
} catch(err) {
@@ -114,7 +114,7 @@ function getLocalNodeFiles(dir, skipValidNodeRedModules) {
files.forEach(function(fn) {
var stats = fs.statSync(path.join(dir,fn));
if (stats.isFile()) {
if (/\.js$/.test(fn)) {
if (/\.[\w]?js$/.test(fn)) {
var info = getLocalFile(path.join(dir,fn));
if (info) {
result.push(info);