From 3261ab597f336034472ba1148793fb49735d1b2d Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 15 Feb 2021 16:28:18 -0500 Subject: [PATCH] Make it easier to configure arvados in vscode Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .vscode/tasks.json | 12 +++--------- scripts/configure-arv | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cde038f..66d52b3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -16,7 +16,7 @@ { "label": "Configure Arvados", "type": "shell", - "command": "scripts/configure-arv ${input:api_host} ${input:api_token}", + "command": "scripts/configure-arv '${input:api_info}'", "problemMatcher": [] }, { @@ -28,15 +28,9 @@ ], "inputs": [ { - "id": "api_host", + "id": "api_info", "type": "promptString", - "description": "Value for ARVADOS_API_HOST" - }, - { - "id": "api_token", - "type": "promptString", - "description": "Value for ARVADOS_API_TOKEN", - "password": true + "description": "Current API_TOKEN and API_HOST from Workbench" }, { "id": "project_uuid", diff --git a/scripts/configure-arv b/scripts/configure-arv index 6bd865c..5a58be3 100755 --- a/scripts/configure-arv +++ b/scripts/configure-arv @@ -1,4 +1,4 @@ #!/bin/sh -echo $1 > API_HOST -echo $2 > API_TOKEN +echo "$*" | sed 's/.*ARVADOS_API_TOKEN=\([^ ]*\).*/\1/' > API_TOKEN +echo "$*" | sed 's/.*ARVADOS_API_HOST=\([^ ]*\).*/\1/' > API_HOST chmod og-rw API_HOST API_TOKEN \ No newline at end of file -- 2.30.2