Remove .js suffix from node invocations

Remove the .js suffix from help texts of node invocations as well as
actual invocations as this is not necessary.  Removing it opens up the
possibility of restructuring the code into a directory with the same
name.
This commit is contained in:
Hornwitser committed 2019-10-28 19:45:32 +01:00
1 parent a9a382b993
commit 6bde8a2219
6 files changed
+34 -34

No files matched your search

+12 -12
View File
@@ -105,15 +105,15 @@ function needleOptionsWithTokenAuthHeader(config) {
function printUsage() {
console.error("Usage: ");
console.error("node client.js start [instance name]");
console.error("node client.js list");
console.error("node client.js delete [instance]");
console.error("node client start [instance name]");
console.error("node client list");
console.error("node client delete [instance]");
console.error("To download the latest version of the Clusterio lua mod, do");
console.error("node client.js manage shared mods download clusterio");
console.error("node client manage shared mods download clusterio");
console.error("To download a clusterio plugin, do");
console.error("node client.js manage shared plugins install https://github.com/Danielv123/playerManager");
console.error("node client manage shared plugins install https://github.com/Danielv123/playerManager");
console.error("For more management options, do");
console.error("node client.js manage");
console.error("node client manage");
}
async function listInstances(config) {
@@ -133,14 +133,14 @@ async function listInstances(config) {
async function manage(config, instance) {
// console.log("Launching mod manager");
//const fullUsage = 'node client.js manage [instance, "shared"] ["mods", "config"] ...';
//const fullUsage = 'node client manage [instance, "shared"] ["mods", "config"] ...';
function usage(instance, tool, action){
if(tool && tool == "mods"){
console.log('node client.js manage '+instance.name+' '+tool+' ["list", "search", "add", "remove"]');
console.log('node client manage '+instance.name+' '+tool+' ["list", "search", "add", "remove"]');
} else if(tool && tool == "plugins") {
console.log(`node client.js manage ${instance.name} ${tool} ["list", "add", "remove"]`);
console.log(`node client manage ${instance.name} ${tool} ["list", "add", "remove"]`);
} else {
console.log('node client.js manage '+(instance && instance.name || '[instance, "shared"]') +' '+ (tool || '["mods", "plugins"]') + ' ...');
console.log('node client manage '+(instance && instance.name || '[instance, "shared"]') +' '+ (tool || '["mods", "plugins"]') + ' ...');
}
}
const tool = process.argv[4] || "";
@@ -197,7 +197,7 @@ async function manage(config, instance) {
async function deleteInstance(instance) {
if (instance === undefined) {
console.error("Usage: node client.js delete [instance]");
console.error("Usage: node client delete [instance]");
process.exit(1);
} else if (fs.existsSync(instance.path())) {
fileOps.deleteFolderRecursiveSync(instance.path()); // TODO: Check if this can cause i-craft users to format their server by using wrong paths
@@ -546,7 +546,7 @@ async function startClient() {
await downloadMod();
} else if (command == "start" && instance === undefined) {
console.error("ERROR: No instanceName provided!");
console.error("Usage: node client.js start [instanceName]");
console.error("Usage: node client start [instanceName]");
process.exit(0);
} else if (command == "start" && !fs.existsSync(instance.path())) {
await createInstance(config, args, instance);