1
0
Fork 0
forked from svrjs/svrjs

Make generateServerString() function replace spaces in name property of svrjs.json with dashes.

This commit is contained in:
Dorian Niemiec 2024-08-25 13:13:16 +02:00
parent 7decde6b58
commit b5de4b79c5

View file

@ -4,7 +4,7 @@ const getOS = require("./getOS.js");
function generateServerString(exposeServerVersion) { function generateServerString(exposeServerVersion) {
return exposeServerVersion return exposeServerVersion
? name + ? name.replace(/ /g, "-") +
"/" + "/" +
version + version +
" (" + " (" +
@ -14,7 +14,7 @@ function generateServerString(exposeServerVersion) {
? "Bun/v" + process.versions.bun + "; like Node.JS/" + process.version ? "Bun/v" + process.versions.bun + "; like Node.JS/" + process.version
: "Node.JS/" + process.version) + : "Node.JS/" + process.version) +
")" ")"
: name; : name.replace(/ /g, "-");
} }
module.exports = generateServerString; module.exports = generateServerString;