|
64 | 64 | "Print VERSION's release notes, defaulting to 'Unreleased'." |
65 | 65 | (princ (-release-notes version))) |
66 | 66 |
|
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)) |
70 | 75 | (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))) |
72 | 80 | (time (decode-time (current-time))) |
73 | 81 | (date (format "%d-%02d-%02d" (nth 5 time) (nth 4 time) (nth 3 time)))) |
74 | 82 | (unless (version< current next) |
|
79 | 87 | (warn "Release notes are empty!") |
80 | 88 | (message "Release notes:\n%s\n" rel-notes)) |
81 | 89 | (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))) |
87 | 96 | (-with-file-edits tsc.el |
88 | 97 | (-modify-regexp "Version: *\\(.*\\)" next) |
89 | | - (-modify-regexp "tsc--dyn-version.*\"\\(.*\\)\"" next)) |
| 98 | + (unless lisp-only |
| 99 | + (-modify-regexp "tsc--dyn-version.*\"\\(.*\\)\"" next))) |
90 | 100 | (-with-file-edits tree-sitter.el |
91 | 101 | (-modify-regexp "Version: *\\(.*\\)" next) |
92 | 102 | (-modify-regexp "Package-Requires:.*\(tsc *\"\\(.*\\)\"" next)) |
|
0 commit comments