diff options
| author | Teddy Wing | 2021-02-03 23:25:30 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2021-02-03 23:25:30 +0100 | 
| commit | b19c948b058a94a7b4f5de01b6642d0303ec214d (patch) | |
| tree | 43993f974702b34e322aa90ac0f4177426fccd43 | |
| parent | 2ec9b50b38a9c896db253f9af841af36d703a4f3 (diff) | |
| download | extreload-b19c948b058a94a7b4f5de01b6642d0303ec214d.tar.bz2 | |
main: Replace hard-coded extension ID with list from command line args
Reload the extension IDs given on the command line now that we have them
from the `config` object. Replace the hard-coded extension ID that I had
been using for testing.
| -rw-r--r-- | l/src/main.lisp | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/l/src/main.lisp b/l/src/main.lisp index caadfe3..9a0ea79 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -24,7 +24,9 @@      ;; TODO: error if no `socket-url`      (with-websocket-connection (*client*) -      (wsd:on :message *client* #'ws-on-message) +      (wsd:on :message *client* +              #'(lambda (message) +                  (ws-on-message message (extension-ids config))))        ; (wsd:on :message *client* #'(lambda (message) (ws-on-message message)))        ;; TODO: Maybe defvar *config* and store client in the config @@ -32,13 +34,13 @@        (wait-group:wait *wg*)))) -(defun ws-on-message (message) +(defun ws-on-message (message extension-ids)    (let* ((response (jsown:parse message))           (targets (parse-get-targets-response response)))      (if targets          (reload-extensions            (extension-targets targets) -          '("pacpdcpgfbpkdpmhfaljffnfbdanmblh"))) +          extension-ids))      (if (target-attached-to-target-msg-p response)          (reload-extension | 
