File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 90
90
91
91
(defconst php-mode-version-id
92
92
(eval-when-compile
93
- (let* ((fallback-version (format " %s -non-vcs" (with-no-warnings php-mode-version-number))))
93
+ (let ((fallback-version (format " %s -non-vcs" (with-no-warnings php-mode-version-number))))
94
94
(if (locate-dominating-file default-directory " .git" )
95
- (string-trim-left (string-trim-right (shell-command-to-string " git describe --tags" )) " v" )
95
+ (save-match-data
96
+ (let ((tag (replace-regexp-in-string
97
+ (rx bos " v" ) " "
98
+ (shell-command-to-string " git describe --tags" )))
99
+ (pattern (rx (group (+ any)) eol)))
100
+ (if (string-match pattern tag)
101
+ (match-string 0 tag)
102
+ (error " Faild to obtain git tag " ))))
96
103
fallback-version)))
97
104
" PHP Mode build ID.
98
105
You can’t perform that action at this time.
0 commit comments