mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-18 16:25:13 +00:00
More refactoring of startup.js
This commit is contained in:
37
core/modules/startup/commands.js
Normal file
37
core/modules/startup/commands.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*\
|
||||
title: $:/core/modules/startup/commands.js
|
||||
type: application/javascript
|
||||
module-type: startup
|
||||
|
||||
Command processing
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
// Export name and synchronous status
|
||||
exports.name = "commands";
|
||||
exports.platforms = ["node"];
|
||||
exports.after = ["story"];
|
||||
exports.synchronous = false;
|
||||
|
||||
exports.startup = function(callback) {
|
||||
// On the server, start a commander with the command line arguments
|
||||
var commander = new $tw.Commander(
|
||||
$tw.boot.argv,
|
||||
function(err) {
|
||||
if(err) {
|
||||
console.log("Error: " + err);
|
||||
}
|
||||
callback();
|
||||
},
|
||||
$tw.wiki,
|
||||
{output: process.stdout, error: process.stderr}
|
||||
);
|
||||
commander.execute();
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user