/*\ title: $:/core/modules/commands/wikitest.js type: application/javascript module-type: command wikitest command \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; exports.info = { name: "wikitest", synchronous: true }; var Command = function(params,commander) { this.params = params; this.commander = commander; }; Command.prototype.execute = function() { if(this.params.length <1) { return "Missing parameters"; } var fs = require("fs"), path = require("path"), testdirectory = this.params[0], saveResults = this.params[1] === "save", files = fs.readdirSync(testdirectory), titles = [], f,t,extname,basename; for(f=0; f 1) { throw "Cannot use .JSON files"; } this.commander.wiki.addTiddler(new $tw.Tiddler(tiddlers[0])); titles.push(tiddlers[0].title); } } for(t=0; t