mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
Extract new pb/update-or-insert-version function
This commit is contained in:
parent
7e687f3d39
commit
7828be20df
1 changed files with 10 additions and 4 deletions
|
@ -489,6 +489,15 @@ The file is written to `package-build-working-dir'."
|
|||
(expand-file-name (concat file-name "-readme.txt")
|
||||
package-build-archive-dir))))))
|
||||
|
||||
(defun pb/update-or-insert-version (version)
|
||||
"Ensure current buffer has a \"Version: VERSION\" header."
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward "^;;;* *Version: *" nil t)
|
||||
(kill-whole-line)
|
||||
(forward-line))
|
||||
(insert (format ";;; Version: %s" version))
|
||||
(newline))
|
||||
|
||||
(defun pb/get-package-info (file-path)
|
||||
"Get a vector of package info from the docstrings in FILE-PATH."
|
||||
(when (file-exists-p file-path)
|
||||
|
@ -497,10 +506,7 @@ The file is written to `package-build-working-dir'."
|
|||
(insert-file-contents file-path)
|
||||
;; next few lines are a hack for some packages that aren't
|
||||
;; commented properly.
|
||||
(goto-char (point-min))
|
||||
(forward-line)
|
||||
(insert ";;; Version: 0")
|
||||
(newline)
|
||||
(pb/update-or-insert-version "0")
|
||||
(goto-char (point-max))
|
||||
(newline)
|
||||
(insert ";;; " (file-name-nondirectory file-path) " ends here")
|
||||
|
|
Loading…
Reference in a new issue