Skip to content

Commit

Permalink
Fix tiddlywiki editions command (#8535)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmario authored Aug 21, 2024
1 parent 3fe66bb commit 999f74e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions core/modules/utils/edition-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ 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);
if(info) {
editionInfo[entry] = info;
// 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;
}
}
}
}
Expand All @@ -41,4 +45,4 @@ exports.getEditionInfo = function() {
return editionInfo;
};

})();
})();

0 comments on commit 999f74e

Please sign in to comment.