mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-30 23:23:02 +00:00 
			
		
		
		
	Add --build command
				
					
				
			First pass at the build system described in #356. To test it, move to a new, empty directory and try `tiddlywiki editions/tw5.com --verbose --build`
This commit is contained in:
		| @@ -31,10 +31,11 @@ Command.prototype.execute = function() { | ||||
| 		fs = require("fs"), | ||||
| 		path = require("path"), | ||||
| 		title = this.params[0], | ||||
| 		filename = this.params[1], | ||||
| 		filename = path.resolve(this.commander.outputPath,this.params[1]), | ||||
| 		tiddler = this.commander.wiki.getTiddler(title), | ||||
| 		type = tiddler.fields.type || "text/vnd.tiddlywiki", | ||||
| 		contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"}; | ||||
| 	$tw.utils.createFileDirectories(filename); | ||||
| 	fs.writeFile(filename,tiddler.fields.text,contentTypeInfo.encoding,function(err) { | ||||
| 		self.callback(err); | ||||
| 	}); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene