fix: Cannot start without --services argument, regressed in 41d7cc26b5

closes #3984
This commit is contained in:
Tom Moor
2022-08-18 09:48:28 +02:00
parent 7113b5f604
commit f620a9d34c

View File

@@ -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;
}