Skip to content

Commit

Permalink
Revert string-trim-right
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Nov 3, 2022
1 parent 08ef915 commit 9603a4f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lisp/php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@

(defconst php-mode-version-id
(eval-when-compile
(let* ((fallback-version (format "%s-non-vcs" (with-no-warnings php-mode-version-number))))
(let ((fallback-version (format "%s-non-vcs" (with-no-warnings php-mode-version-number))))
(if (locate-dominating-file default-directory ".git")
(string-trim-left (string-trim-right (shell-command-to-string "git describe --tags")) "v")
(save-match-data
(let ((tag (replace-regexp-in-string
(rx bos "v") ""
(shell-command-to-string "git describe --tags")))
(pattern (rx (group (+ any)) eol)))
(if (string-match pattern tag)
(match-string 0 tag)
(error "Faild to obtain git tag"))))
fallback-version)))
"PHP Mode build ID.
Expand Down

0 comments on commit 9603a4f

Please sign in to comment.