diff --git a/modules/home/users/crumb/emacs/modules/syd-projects.el b/modules/home/users/crumb/emacs/modules/syd-projects.el index b04455b..6214333 100755 --- a/modules/home/users/crumb/emacs/modules/syd-projects.el +++ b/modules/home/users/crumb/emacs/modules/syd-projects.el @@ -25,6 +25,17 @@ (add-to-list 'project-switch-commands (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 ;; Emacs built-in project.el. It's more lightweight, while still featureful. (use-package projection