1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-21 03:39:43 +00:00

Fix tiddlywiki editions command (#8535)

This commit is contained in:
Mario Pietsch 2024-08-21 10:23:44 +02:00 committed by GitHub
parent 3fe66bb80f
commit 999f74ee86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,8 +29,11 @@ exports.getEditionInfo = function() {
for(var entryIndex=0; entryIndex<entries.length; entryIndex++) {
var entry = entries[entryIndex];
// Check if directories have a valid tiddlywiki.info
if(!editionInfo[entry] && $tw.utils.isDirectory(path.resolve(editionPath,entry))) {
var info = $tw.utils.parseJSONSafe(fs.readFileSync(path.resolve(editionPath,entry,"tiddlywiki.info"),"utf8"),null);
// Check if the entry is a hidden directory
if((entry.charAt(0) !== ".") && !editionInfo[entry] && $tw.utils.isDirectory(path.resolve(editionPath,entry))) {
var file=path.resolve(editionPath,entry,"tiddlywiki.info");
if(fs.existsSync(file)) {
var info = $tw.utils.parseJSONSafe(fs.readFileSync(file,"utf8"),null);
if(info) {
editionInfo[entry] = info;
}
@ -38,6 +41,7 @@ exports.getEditionInfo = function() {
}
}
}
}
return editionInfo;
};