Make it easier to configure arvados in vscode main
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 15 Feb 2021 21:28:18 +0000 (16:28 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 15 Feb 2021 21:28:18 +0000 (16:28 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

.vscode/tasks.json
scripts/configure-arv

index cde038ff1200cc9dbaf75fcc4db886908802e5a9..66d52b330b5cef78aa6a1e4403034760dc08ca5d 100644 (file)
@@ -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": []
         },
         {
     ],
     "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",
index 6bd865c127db87fe63e4ca36e93d34dfd392fc4f..5a58be3b53d4b3ce5886f24d5336a5bef1103bb7 100755 (executable)
@@ -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