From ccc7f31e3ab5439c8ceeaa8716b634bc8ffb226a Mon Sep 17 00:00:00 2001 From: YourFriendlyNeighborhoodDealer Date: Mon, 25 Feb 2019 09:44:00 +0100 Subject: [PATCH] motd.js param fix --- motd.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/motd.js b/motd.js index fcde954..a8f7d02 100755 --- a/motd.js +++ b/motd.js @@ -1,15 +1,17 @@ const utils = require('./utils.js'); const dataFile = "public/data.json"; -if (GetParams().length <= 0) { +var p = GetParams(); +if (p.length <= 0) { console.log("no params!"); process.exit(0); } -var param = GetParams().join(" "); + +var param = p.join(" "); +console.log("param: " + param); var d = utils.ReadFile(dataFile); var parsed = JSON.parse(d); -console.log(param); parsed.motd = param; utils.WriteFile(JSON.stringify(parsed), dataFile);