From f13fc85141a28c73fee062f3a37861bded64e642 Mon Sep 17 00:00:00 2001 From: Madeleine Sydney Date: Fri, 11 Apr 2025 01:49:52 -0600 Subject: [PATCH] feat(emacs): syd-project-checkout --- .../home/users/crumb/emacs/modules/syd-projects.el | 11 +++++++++++ 1 file changed, 11 insertions(+) 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