feat(emacs): syd-project-checkout
This commit is contained in:
@@ -25,6 +25,17 @@
|
|||||||
(add-to-list 'project-switch-commands
|
(add-to-list 'project-switch-commands
|
||||||
(funcall switch-cmd #'syd-project-root-find-file "Browse"))))
|
(funcall switch-cmd #'syd-project-root-find-file "Browse"))))
|
||||||
|
|
||||||
|
(defun syd-project-checkout (repo-uri)
|
||||||
|
(interactive (list (read-string "Repo: ")))
|
||||||
|
(let* ((repo-name
|
||||||
|
(when (string-match (rx "/" (group-n 1 (+ (any alphanumeric "-_")))
|
||||||
|
(? ".git") eol)
|
||||||
|
repo-uri)
|
||||||
|
(match-string 1 repo-uri)))
|
||||||
|
(dest (file-name-concat (expand-file-name "~/git") repo-name)))
|
||||||
|
(shell-command (format "git clone %s %s" repo-uri dest))
|
||||||
|
(find-file dest)))
|
||||||
|
|
||||||
;; Projection provides a Projectile-like project management library atop
|
;; Projection provides a Projectile-like project management library atop
|
||||||
;; Emacs built-in project.el. It's more lightweight, while still featureful.
|
;; Emacs built-in project.el. It's more lightweight, while still featureful.
|
||||||
(use-package projection
|
(use-package projection
|
||||||
|
|||||||
Reference in New Issue
Block a user