 (setq boop-config-alist
       '((service-fuji jenkins "jenkins.connected-tv.tools.bbc.co.uk" "service-fuji")
         (contract-validation-int jenkins "jenkins.connected-tv.tools.bbc.co.uk" "taf-api-contract-validation-tests-on-int")
-        (taf-router jenkins "jenkins.connected-tv.tools.bbc.co.uk" "taf-router")))
+        (taf-router jenkins "jenkins.connected-tv.tools.bbc.co.uk" "taf-router")
+        (script pass "??")))
 
-(defvar boop-info-alist nil
+(defvar boop-result-alist nil
 	"This is an alist that is created based on the current
 	`boop-config-alist` to keep the results synchronized when
 	performing asynchronous actions")

	:group 'tools
	:group 'convenience)

(defcustom boop-success "1"
	"The echo string to deem a plugin as successful"
	:group 'boop
	:type 'string)

(defcustom boop-success-colour "#63ca13"
	"The colour to use for success."
	:group 'boop
	:type 'string)

(defcustom boop-failure "0"
	"The echo string to deem a plugin as failed"
	:group 'boop
	:type 'string)

(defcustom boop-failure-colour "#c64512"
	"The colour to use for failure."
	:group 'boop
	:type 'string)

(defcustom boop-warning-colour "#ffcb13"
	"The colour to use for success."
	:group 'boop
	:type 'string)

(defcustom boop-monitor-symbol "●"
	"The symbol used as the monitor thing."
	:group 'boop
	:type 'string)

(defcustom boop-execution-strategy 'config
  "The startegy to use for executing plugins.

  (let ((plugins (boop--get-plugin-scripts)))
    (mapcar '(lambda (it) (cons (intern (file-name-base it)) it)) plugins)))

(defun boop-format-result ()
  "Format the result values"
  (mapconcat
   '(lambda (result)
      (let ((form (or (cdr (assoc (cdr result) boop-format-alist))
                      boop-format-default)))
        (boop--propertize form (format "%s" (car result))))) boop-result-alist ""))

(defun boop--propertize (form &optional help-echo)
  (let ((symbol (car form))
        (colour (cadr form)))
    (propertize (format "%s " symbol) 'face `(foreground-color . ,colour) 'help-echo help-echo)))

(defun boop--clear-result-list () (setq boop-result-alist nil))
(defun boop--sync-result-and-config ()
  "Synchronizes the result alist so that it only contains items in the config alist."
  (setq boop-result-alist (--filter (assoc (car it) boop-config-alist) boop-result-alist)))

(defun boop--handle-result (id result)
  "Handle the result of the async `shell-command-to-string`"
  (if (assoc id boop-result-alist)
      (setf (cdr (assoc id boop-result-alist)) result)
    (setq boop-result-alist (append (list (cons id result)) boop-result-alist))))

(defun boop-update-info ()
  "Execute all of the plugins and return a list of the results."
	(let* ((plugins (boop--get-plugin-alist)))
    (boop--sync-result-and-config)
	  (-map (lambda (config)
            (let* ((id (car config))
                   (script (cdr (assoc (cadr config) plugins)))
                   (args (mapconcat 'identity (cddr config) " "))
                   (cmd (format "%s %s" script args)))
              (async-start `(lambda () (shell-command-to-string ,cmd))
                           `(lambda (result) (boop--handle-result (quote ,id) (s-trim result))))))
          boop-config-alist)))

;; Interactive Functions
