summaryrefslogtreecommitdiff
path: root/build-farm-url.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2018-07-14 11:59:39 +0300
committerAlex Kost <alezost@gmail.com>2018-07-16 21:37:19 +0300
commit6ba685d14a8c2d45064eb21d078dac5da9773f28 (patch)
tree3c8e6209ee38ca369734f554de776a388a19150c /build-farm-url.el
parentMove all url procedures to "build-farm-url.el" (diff)
downloademacs-build-farm-6ba685d14a8c2d45064eb21d078dac5da9773f28.tar.gz
url: Improve url type definer
* build-farm-url.el (build-farm-type-by-url): Rename to... (build-farm-url-type): ... this. Make 'url' argument optional. Check if URL contains "cuirass".
Diffstat (limited to 'build-farm-url.el')
-rw-r--r--build-farm-url.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/build-farm-url.el b/build-farm-url.el
index 99891bc..b0b575e 100644
--- a/build-farm-url.el
+++ b/build-farm-url.el
@@ -62,15 +62,18 @@ Interactively, prompt for URL"
(interactive (list (build-farm-read-url)))
(setq build-farm-url url))
-(defun build-farm-type-by-url (url)
- "Return build farm type by its URL."
- (or (bui-assoc-value build-farm-url-alist url)
- (progn
+(defun build-farm-url-type (&optional url)
+ "Return build farm type by its URL (`build-farm-url' by default)."
+ (or (bui-assoc-value build-farm-url-alist
+ (or url build-farm-url))
+ (let ((type (if (string-match-p "cuirass" url)
+ 'cuirass
+ 'hydra)))
(message "Unknown URL: <%s>.
Consider adding it to `build-farm-url-alist'.
-Arbitrarily choosing `hydra' type for this URL."
- url)
- 'hydra)))
+Arbitrarily choosing `%S' type for this URL."
+ url type)
+ type)))
(defun build-farm-url (&rest url-parts)
"Return build farm URL using URL-PARTS.