summaryrefslogtreecommitdiff
path: root/vimulti.clj
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-07-06 09:42:06 +0800
committereltrac <hi@eltr.ac>2026-07-06 09:42:06 +0800
commitb075bfe214bca598863fafe6b6ce3a770aac6e2b (patch)
tree9c8a1b48b933e9977ac5c45ce60709d9d40c7ed5 /vimulti.clj
parent6c06c73eeb159fe86da3cd3a509600365bad9640 (diff)
allow empty tag or branch, like "nvim-lazy:"
defaults to current branch, or use configuration without switching to a tag or a branch
Diffstat (limited to 'vimulti.clj')
-rw-r--r--vimulti.clj7
1 files 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