From 99356db6b984356f4d337bd2067e6f70437fa94d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 8 Aug 2021 11:45:07 -0700 Subject: emacs: add function to clone a git repository --- emacs/custom/fcuny-git.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'emacs/custom') diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el index ac9b837..7cc0feb 100644 --- a/emacs/custom/fcuny-git.el +++ b/emacs/custom/fcuny-git.el @@ -1,4 +1,5 @@ (require 'fcuny-defuns) +(require 'fcuny-vars) (use-package gitconfig-mode :ensure t) @@ -120,4 +121,11 @@ ;; with performances. (setq vc-handled-backends (delq 'Git vc-handled-backends)) +(defun fcuny/clone-repo (url) + "Clone a repository in the workspace" + (interactive "sURL:") + (let* ((repo-name (magit-clone--url-to-name url)) + (target-dir (concat fcuny/path-workspace "/" repo-name))) + (magit-clone-regular url target-dir nil))) + (provide 'fcuny-git) -- cgit 1.4.1