Last active
October 24, 2017 09:33
-
-
Save dotemacs/2c34fd558ae9fd86123e3287fab7893b to your computer and use it in GitHub Desktop.
Open branch in Semaphore CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun semaphore-open-branch () | |
"Open branch in Semaphore CI" | |
(interactive) | |
(let* ((branch (magit-get-current-branch)) | |
(group-repo (replace-regexp-in-string "mobytronics" "mobytrader" | |
(thread-first (magit-get "remote" "origin" "url") | |
(split-string ":") | |
last | |
first | |
(split-string "\\.") | |
first)))) | |
(browse-url (format "https://semaphoreci.com/%s/branches/%s" group-repo branch)))) | |
;; add the below to your magit config | |
(add-hook 'magit-mode-hook | |
(lambda () | |
(local-set-key (kbd "j") 'semaphore-open-branch))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment