From f620a9d34cb3d05da507be1dead129fec3c2e442 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 18 Aug 2022 09:48:28 +0200 Subject: [PATCH] fix: Cannot start without --services argument, regressed in 41d7cc26b5b045a4ede5670bf48a06367c69d1e1 closes #3984 --- server/utils/args.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/utils/args.ts b/server/utils/args.ts index fb9c891a9e..d596d4fe8c 100644 --- a/server/utils/args.ts +++ b/server/utils/args.ts @@ -1,13 +1,12 @@ /** * Get the value of a command line argument * - * @param {string} name The name of the argument - * @param {string} shortName The optioanl short name - * - * @returns {string} The value of the argument. + * @param name The name of the argument + * @param shortName The optioanl short name + * @returns The value of the argument or undefined if the argument is not present */ export function getArg(name: string, shortName?: string) { - return process.argv + const argument = process.argv .slice(2) .filter( (arg) => @@ -15,5 +14,8 @@ export function getArg(name: string, shortName?: string) { (shortName && arg.startsWith(`-${shortName}=`)) ) .map((arg) => arg.split("=")[1]) + .map((arg) => arg.trim()) .join(","); + + return argument || undefined; }