Skip to content

Commit

Permalink
tweak(cocogitto): display error message when not in VC directory
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 8, 2023
1 parent f99bea9 commit e2b85e6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions modules/extras/me-cocogitto.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ restores it after that."
(completing-read "Increment the version: " '(auto major minor patch)))
(when (yes-or-no-p "Is this version a pre-release? ")
(read-string "Pre-release version: "))))
(when-let ((default-directory (vc-root-dir)))
(with-current-buffer (get-buffer-create +cocogitto-buffer-name)
(conf-colon-mode)
(insert (format "############ Cocogitto bump (%s) ############\n" level))
(call-process-shell-command "git stash -u" nil (current-buffer))
(call-process-shell-command
(format "cog bump --%s%s" level (if pre (format " --pre %s" pre) ""))
nil (current-buffer))
(call-process-shell-command "git stash pop" nil (current-buffer))
(message "Cocogitto finished!"))))
(if-let ((default-directory (vc-root-dir)))
(with-current-buffer (get-buffer-create +cocogitto-buffer-name)
(conf-colon-mode)
(insert (format "############ Cocogitto bump (%s) ############\n" level))
(call-process-shell-command "git stash -u" nil (current-buffer))
(call-process-shell-command
(format "cog bump --%s%s" level (if pre (format " --pre %s" pre) ""))
nil (current-buffer))
(call-process-shell-command "git stash pop" nil (current-buffer))
(message "Cocogitto finished!"))
(user-error "Not in a VC managed directory.")))


(provide 'me-cocogitto)
Expand Down

0 comments on commit e2b85e6

Please sign in to comment.