TiddlyDesktop not saving TWc backups when backup folder is missing

16 views
Skip to first unread message

okido

unread,
Jun 10, 2018, 7:48:06 AM6/10/18
to TiddlyWikiDev
Hello Jeremy,

TiddlyDesktop ver 0.0.14 does not save TWc backups if the folder for backups is missing on the filesystem.
If the folder does not exist we need to create it.
Can you update the saveFile function in saving.js with the code here below:

// saving to the local file system,
// filepath, content and backup filename are provided by TWclassic
function saveFile(filepath,content) {
  var fs = require("fs");
  var pathName = filepath.substr(0, filepath.lastIndexOf("/"));
    if (!fs.existsSync(pathName)) fs.mkdirSync(pathName);
    fs.writeFileSync(filepath,content);
}

Have a nice day, Okido


Reply all
Reply to author
Forward
0 new messages