Skip to content

Commit 5e10916

Browse files
committed
bin: Support bin/dev bump-version lisp-only
1 parent 909717c commit 5e10916

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

bin/dev

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,19 @@
6464
"Print VERSION's release notes, defaulting to 'Unreleased'."
6565
(princ (-release-notes version)))
6666

67-
(defun cmd:bump-version (&optional next)
68-
"Increase the patch version. This does not create a git tag."
69-
(let* ((rel-notes (-release-notes))
67+
(defun cmd:bump-version (&optional next-or-flag)
68+
"Increase the version. This does not create a git tag.
69+
70+
If NEXT-OR-FLAG is not given, increase the patch version.
71+
72+
If NEXT-OR-FLAG is \"lisp-only\", only increase the version of the Lisp code. "
73+
(let* (lisp-only
74+
(rel-notes (-release-notes))
7075
(current (-current-version))
71-
(next (or next (-next-version current)))
76+
(next (or (pcase next-or-flag
77+
("lisp-only" (setq lisp-only t) nil)
78+
(_ next-or-flag))
79+
(-next-version current)))
7280
(time (decode-time (current-time)))
7381
(date (format "%d-%02d-%02d" (nth 5 time) (nth 4 time) (nth 3 time))))
7482
(unless (version< current next)
@@ -79,14 +87,16 @@
7987
(warn "Release notes are empty!")
8088
(message "Release notes:\n%s\n" rel-notes))
8189
(message " Bumping version %s -> %s" current next)
82-
(-with-file-edits Cargo.toml
83-
(-modify-regexp "version *= *\"\\(.*\\)\"" next))
84-
(-with-file-edits Cargo.lock
85-
(search-forward "name = \"emacs-tree-sitter\"")
86-
(-modify-regexp "version *= *\"\\(.*\\)\"" next))
90+
(unless lisp-only
91+
(-with-file-edits Cargo.toml
92+
(-modify-regexp "version *= *\"\\(.*\\)\"" next))
93+
(-with-file-edits Cargo.lock
94+
(search-forward "name = \"emacs-tree-sitter\"")
95+
(-modify-regexp "version *= *\"\\(.*\\)\"" next)))
8796
(-with-file-edits tsc.el
8897
(-modify-regexp "Version: *\\(.*\\)" next)
89-
(-modify-regexp "tsc--dyn-version.*\"\\(.*\\)\"" next))
98+
(unless lisp-only
99+
(-modify-regexp "tsc--dyn-version.*\"\\(.*\\)\"" next)))
90100
(-with-file-edits tree-sitter.el
91101
(-modify-regexp "Version: *\\(.*\\)" next)
92102
(-modify-regexp "Package-Requires:.*\(tsc *\"\\(.*\\)\"" next))

0 commit comments

Comments
 (0)