From 73e5c5ccfe408e58eb4bb927c71a77e0fceb22c4 Mon Sep 17 00:00:00 2001 From: neelkamath Date: Fri, 11 May 2018 20:46:12 +0530 Subject: Remove forgettable, unused, occasionally harmful (w.r.t. ES6) directive --- server/src/commands/admin/saveconfig.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'server/src/commands/admin/saveconfig.js') diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js index 0c4e0c9..ed3a312 100644 --- a/server/src/commands/admin/saveconfig.js +++ b/server/src/commands/admin/saveconfig.js @@ -2,8 +2,6 @@ Description: Writes any changes to the config to the disk */ -'use strict'; - exports.run = async (core, server, socket, data) => { if (socket.uType != 'admin') { // ignore if not admin -- cgit v1.2.1 From acbad15f2bc4a6733407bc17e1a5b4190ed3b287 Mon Sep 17 00:00:00 2001 From: neelkamath Date: Sat, 12 May 2018 14:13:12 +0530 Subject: Remove unused object fields --- server/src/commands/admin/saveconfig.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'server/src/commands/admin/saveconfig.js') diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js index ed3a312..116abd6 100644 --- a/server/src/commands/admin/saveconfig.js +++ b/server/src/commands/admin/saveconfig.js @@ -30,7 +30,4 @@ exports.run = async (core, server, socket, data) => { }, { uType: 'mod' }); }; -exports.info = { - name: 'saveconfig', - description: 'Saves current config' -}; +exports.info = { name: 'saveconfig' }; -- cgit v1.2.1 From 343157350f627b9495184246a90033a1c41f1a2c Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:03:22 +0530 Subject: Re-add module documentation --- server/src/commands/admin/saveconfig.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/src/commands/admin/saveconfig.js') diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js index 116abd6..ed3a312 100644 --- a/server/src/commands/admin/saveconfig.js +++ b/server/src/commands/admin/saveconfig.js @@ -30,4 +30,7 @@ exports.run = async (core, server, socket, data) => { }, { uType: 'mod' }); }; -exports.info = { name: 'saveconfig' }; +exports.info = { + name: 'saveconfig', + description: 'Saves current config' +}; -- cgit v1.2.1 From 2bb5ced363b692a5696b176bc317fe525c0c05df Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:09:55 +0530 Subject: Flatten --- server/src/commands/admin/saveconfig.js | 36 --------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 server/src/commands/admin/saveconfig.js (limited to 'server/src/commands/admin/saveconfig.js') diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js deleted file mode 100644 index ed3a312..0000000 --- a/server/src/commands/admin/saveconfig.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - Description: Writes any changes to the config to the disk -*/ - -exports.run = async (core, server, socket, data) => { - if (socket.uType != 'admin') { - // ignore if not admin - return; - } - - let saveResult = core.managers.config.save(); - - if (!saveResult) { - server.reply({ - cmd: 'warn', - text: 'Failed to save config, check logs.' - }, client); - - return; - } - - server.reply({ - cmd: 'info', - text: 'Config saved!' - }, socket); - - server.broadcast({ - cmd: 'info', - text: 'Config saved!' - }, { uType: 'mod' }); -}; - -exports.info = { - name: 'saveconfig', - description: 'Saves current config' -}; -- cgit v1.2.1 From 949404cd1aad8492ae0338130f16054adfa38ab7 Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:37:56 +0530 Subject: Prevent fucking shit up --- server/src/commands/admin/saveconfig.js | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 server/src/commands/admin/saveconfig.js (limited to 'server/src/commands/admin/saveconfig.js') diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js new file mode 100644 index 0000000..ed3a312 --- /dev/null +++ b/server/src/commands/admin/saveconfig.js @@ -0,0 +1,36 @@ +/* + Description: Writes any changes to the config to the disk +*/ + +exports.run = async (core, server, socket, data) => { + if (socket.uType != 'admin') { + // ignore if not admin + return; + } + + let saveResult = core.managers.config.save(); + + if (!saveResult) { + server.reply({ + cmd: 'warn', + text: 'Failed to save config, check logs.' + }, client); + + return; + } + + server.reply({ + cmd: 'info', + text: 'Config saved!' + }, socket); + + server.broadcast({ + cmd: 'info', + text: 'Config saved!' + }, { uType: 'mod' }); +}; + +exports.info = { + name: 'saveconfig', + description: 'Saves current config' +}; -- cgit v1.2.1