Merge 4920611b69f124757f4c97b3f97c6f3fe7854f5c into 2feb290ae3c6cd88c16e4c27c2006a569e0146e2

This commit is contained in:
Pez Cuckow 2025-02-26 10:38:27 +01:00 committed by GitHub
commit a07b7e7b4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);