| OLD | NEW |
| 1 ; To use this, | 1 ; To use this, |
| 2 ; 1) Add to init.el: | 2 ; 1) Add to init.el: |
| 3 ; (setq-default chrome-root "/path/to/chrome/src/") | 3 ; (setq-default chrome-root "/path/to/chrome/src/") |
| 4 ; (add-to-list 'load-path (concat chrome-root "tools/emacs")) | 4 ; (add-to-list 'load-path (concat chrome-root "tools/emacs")) |
| 5 ; (require 'trybot) | 5 ; (require 'trybot) |
| 6 ; 2) Run on trybot output: | 6 ; 2) Run on trybot output: |
| 7 ; M-x trybot | 7 ; M-x trybot |
| 8 ; | 8 ; |
| 9 ; To hack on this, | 9 ; To hack on this, |
| 10 ; M-x eval-buffer | 10 ; M-x eval-buffer |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 (let ((on-fetch-completion | 101 (let ((on-fetch-completion |
| 102 (lambda (process state) | 102 (lambda (process state) |
| 103 (switch-to-buffer (process-buffer process)) | 103 (switch-to-buffer (process-buffer process)) |
| 104 (when (equal state "finished\n") | 104 (when (equal state "finished\n") |
| 105 (trybot-fixup (process-get process 'type-hint))))) | 105 (trybot-fixup (process-get process 'type-hint))))) |
| 106 (command (concat "curl -s " url | 106 (command (concat "curl -s " url |
| 107 (when (eq type-hint 'mac) | 107 (when (eq type-hint 'mac) |
| 108 ; Pipe it through the output shortener. | 108 ; Pipe it through the output shortener. |
| 109 (concat " | " (get-chrome-root) | 109 (concat " | " (get-chrome-root) |
| 110 "build/sanitize-mac-build-log.sed"))))) | 110 "build/sanitize-mac-build-log.sh"))))) |
| 111 | 111 |
| 112 ; Start up the subprocess. | 112 ; Start up the subprocess. |
| 113 (let* ((coding-system-for-read 'utf-8-dos) | 113 (let* ((coding-system-for-read 'utf-8-dos) |
| 114 (buffer (trybot-get-new-buffer)) | 114 (buffer (trybot-get-new-buffer)) |
| 115 (process (start-process-shell-command "curl" buffer command))) | 115 (process (start-process-shell-command "curl" buffer command))) |
| 116 ; Attach the type hint to the process so we can get it back when | 116 ; Attach the type hint to the process so we can get it back when |
| 117 ; the process completes. | 117 ; the process completes. |
| 118 (process-put process 'type-hint type-hint) | 118 (process-put process 'type-hint type-hint) |
| 119 (set-process-query-on-exit-flag process nil) | 119 (set-process-query-on-exit-flag process nil) |
| 120 (set-process-sentinel process on-fetch-completion)))) | 120 (set-process-sentinel process on-fetch-completion)))) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 (setq url (concat url "/text"))) | 155 (setq url (concat url "/text"))) |
| 156 | 156 |
| 157 (let ((type-hint (cond ((string-match "/win/" url) 'win) | 157 (let ((type-hint (cond ((string-match "/win/" url) 'win) |
| 158 ((string-match "/mac/" url) 'mac) | 158 ((string-match "/mac/" url) 'mac) |
| 159 ; Match /linux, /linux_view, etc. | 159 ; Match /linux, /linux_view, etc. |
| 160 ((string-match "/linux" url) 'linux) | 160 ((string-match "/linux" url) 'linux) |
| 161 (t 'unknown)))) | 161 (t 'unknown)))) |
| 162 (trybot-fetch type-hint url))) | 162 (trybot-fetch type-hint url))) |
| 163 | 163 |
| 164 (provide 'trybot) | 164 (provide 'trybot) |
| OLD | NEW |