2022-05-11 15:39:47 +00:00
|
|
|
;;; package-build-badges.el --- Create batches for packages -*- lexical-binding:t; coding:utf-8 -*-
|
2020-02-24 10:34:31 +00:00
|
|
|
|
2022-05-11 15:39:47 +00:00
|
|
|
;; Copyright (C) 2011-2022 Donald Ephraim Curtis
|
|
|
|
;; Copyright (C) 2012-2022 Steve Purcell
|
|
|
|
;; Copyright (C) 2018-2022 Jonas Bernoulli
|
|
|
|
;; Copyright (C) 2009 Phil Hagelberg
|
2020-02-24 10:34:31 +00:00
|
|
|
|
|
|
|
;; Author: Donald Ephraim Curtis <dcurtis@milkbox.net>
|
2022-05-11 15:39:47 +00:00
|
|
|
;; Homepage: https://github.com/melpa/package-build
|
|
|
|
;; Keywords: maint tools
|
2020-02-24 10:34:31 +00:00
|
|
|
|
2022-05-11 15:39:47 +00:00
|
|
|
;; SPDX-License-Identifier: GPL-3.0-or-later
|
2020-02-24 10:34:31 +00:00
|
|
|
|
2022-05-11 15:39:47 +00:00
|
|
|
;; This file is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published
|
|
|
|
;; by the Free Software Foundation, either version 3 of the License,
|
|
|
|
;; or (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This file is distributed in the hope that it will be useful,
|
2020-02-24 10:34:31 +00:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
2022-05-11 15:39:47 +00:00
|
|
|
;;
|
2020-02-24 10:34:31 +00:00
|
|
|
;; You should have received a copy of the GNU General Public License
|
2022-05-11 15:39:47 +00:00
|
|
|
;; along with this file. If not, see <https://www.gnu.org/licenses/>.
|
2020-02-24 10:34:31 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; In future we should provide a hook. Note also that it would be
|
|
|
|
;; straightforward to generate the SVG ourselves, which would save
|
|
|
|
;; the network overhead.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2022-05-11 15:39:47 +00:00
|
|
|
(defvar package-build-stable)
|
2020-02-24 10:34:31 +00:00
|
|
|
|
|
|
|
(defun package-build--write-melpa-badge-image (name version target-dir)
|
2021-01-10 20:14:15 +00:00
|
|
|
(unless (zerop (call-process
|
|
|
|
"curl" nil nil nil "-f" "-o"
|
|
|
|
(expand-file-name (concat name "-badge.svg") target-dir)
|
|
|
|
(format "https://img.shields.io/badge/%s-%s-%s.svg"
|
|
|
|
(if package-build-stable "melpa stable" "melpa")
|
|
|
|
(url-hexify-string version)
|
|
|
|
(if package-build-stable "3e999f" "922793"))))
|
|
|
|
(message "Failed to fetch badge")))
|
2020-02-24 10:34:31 +00:00
|
|
|
|
|
|
|
(provide 'package-build-badges)
|
|
|
|
;;; package-badges.el ends here
|