From 3d58c2a3d79a70eaf534bd078572bf048e16f771 Mon Sep 17 00:00:00 2001 From: Kai Jellinghaus Date: Thu, 24 Nov 2022 20:38:45 +0100 Subject: [PATCH] Handle values correctly --- cli/script.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/script.ts b/cli/script.ts index efe67137ef..463e5b5bd3 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -175,6 +175,10 @@ async function list(opts: GlobalOptions & { showArchived?: boolean }) { export async function resolve(inputs: string[]): Promise> { let result = {}; + if (!inputs) { + return result; + } + for (const input of inputs) { let jsonObj; if (input.startsWith("@")) { @@ -190,7 +194,8 @@ export async function resolve(inputs: string[]): Promise> { jsonObj = JSON.parse(input); } else { const key = input.split("=", 1)[0]; - jsonObj = Object.fromEntries([[key, input.substring(key.length)]]); + const value = JSON.parse(input.substring(key.length + 1)); + jsonObj = Object.fromEntries([[key, value]]); } } result = { ...result, ...jsonObj };