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 9090
9191(defconst php-mode-version-id
9292 (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))))
9494 (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 " ))))
96103 fallback-version)))
97104 " PHP Mode build ID.
98105
You can’t perform that action at this time.
0 commit comments