1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-30 06:36:17 +00:00
TiddlyWiki5/plugins/tiddlywiki/multiwikiserver/modules/command-mws-load-tiddlers.js

41 lines
819 B
JavaScript
Raw Normal View History

/*\
title: $:/plugins/tiddlywiki/multiwikiserver/mws-load-tiddlers.js
type: application/javascript
module-type: command
Command to recursively load a directory of tiddler files into a bag
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "mws-load-tiddlers",
synchronous: true
};
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
var self = this;
// Check parameters
if(this.params.length < 2) {
return "Missing pathname and/or bagname";
}
var tiddlersPath = this.params[0],
bagName = this.params[1];
$tw.mws.store.saveTiddlersFromPath(tiddlersPath,bagName);
return null;
};
exports.Command = Command;
})();