From b075bfe214bca598863fafe6b6ce3a770aac6e2b Mon Sep 17 00:00:00 2001 From: eltrac Date: Mon, 6 Jul 2026 09:42:06 +0800 Subject: allow empty tag or branch, like "nvim-lazy:" defaults to current branch, or use configuration without switching to a tag or a branch --- vimulti.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vimulti.clj b/vimulti.clj index 5f862f1..30c6c25 100644 --- a/vimulti.clj +++ b/vimulti.clj @@ -50,13 +50,14 @@ (let [separator (if branch-style? #":" (if tag-style? #"@" #" ")) target-array (str/split target separator) app-name (if (= (first target-array) "") "nvim" (first target-array)) - repo (fs/path (System/getProperty "user.home") ".config" app-name)] + repo (fs/path (System/getProperty "user.home") ".config" app-name) + no-mark (= (count target-array) 1)] (when (> (count target-array) 2) (println "Invalid target string.") (System/exit 1)) (cond-> {:app-name app-name} - branch-style? (assoc :branch (last target-array)) - tag-style? (assoc :tag (last target-array)) + branch-style? (assoc :branch (when-not no-mark (last target-array))) + tag-style? (assoc :tag (when-not no-mark (last target-array))) (fs/exists? repo) (assoc :repo repo)))))) ;; main -- cgit v1.2.3