1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-03 07:18:06 +00:00

Enhance savetiddlers command with do not delete option

This commit is contained in:
Jermolene
2015-09-03 08:54:17 +01:00
parent 4ccdaf3faf
commit 5176f008f0
2 changed files with 7 additions and 2 deletions

View File

@@ -35,8 +35,11 @@ Command.prototype.execute = function() {
wiki = this.commander.wiki,
filter = this.params[0],
pathname = path.resolve(this.commander.outputPath,this.params[1]),
dontDelete = (this.params[2] || "").toLowerCase() === "-do-not-delete",
tiddlers = wiki.filterTiddlers(filter);
$tw.utils.deleteDirectory(pathname);
if(!dontDelete) {
$tw.utils.deleteDirectory(pathname);
}
$tw.utils.createDirectory(pathname);
$tw.utils.each(tiddlers,function(title) {
var tiddler = self.commander.wiki.getTiddler(title),