Skip to content

Commit

Permalink
refactor: move +github-latest-release to me-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 28, 2023
1 parent feff6e1 commit bca42ac
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
22 changes: 22 additions & 0 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,28 @@ When MAIL-MODE-P is non-nil, treat INFILE as a mail."



;;; Github

;;;###autoload
(defun +github-latest-release (user repo &optional fallback-release)
"Get the latest release of USER/REPO. Strips the \"v\" at left.
Fallback to FALLBACK-RELEASE when it can't get the last one."
(if-let ((latest
(ignore-errors
(with-temp-buffer
(url-insert-file-contents
(format
"https://api.github.com/repos/%s/%s/releases/latest"
user repo))
(json-parse-buffer :object-type 'plist)))))
(string-trim-left
(car (last (split-string (plist-get latest :html_url) "/")))
"v")
fallback-release))



;;; Lock files

(defun +lock--file (name)
Expand Down
16 changes: 6 additions & 10 deletions core/me-loaddefs.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ restores it after that.
(fn LEVEL &optional PRE)" t)
(register-definition-prefixes "../modules/extras/me-cocogitto" '("+cocogitto-buffer-name"))


;;; Generated autoloads from ../modules/extras/me-dap-utils.el

(autoload '+github-latest-release "../modules/extras/me-dap-utils" "\
Get the latest release of USER/REPO. Strips the \"v\" at left.
Fallback to FALLBACK-RELEASE when it can't get the last one.
(fn USER REPO &optional FALLBACK-RELEASE)")


;;; Generated autoloads from ../modules/extras/me-eglot-ltex.el

Expand All @@ -72,6 +62,12 @@ This will overwrite the built-in \"gdb-mi\" for this session." t)

;;; Generated autoloads from me-lib.el

(autoload '+github-latest-release "me-lib" "\
Get the latest release of USER/REPO. Strips the \"v\" at left.
Fallback to FALLBACK-RELEASE when it can't get the last one.
(fn USER REPO &optional FALLBACK-RELEASE)")
(register-definition-prefixes "me-lib" '("+a" "+binary-" "+c" "+d" "+e" "+f" "+h" "+i" "+kill-" "+l" "+m" "+n" "+omap!" "+p" "+quoted-p" "+r" "+s" "+t" "+un" "+v" "+w" "+yank-this-file-name" "minemacs-" "objdump-disassemble-mode"))


Expand Down
32 changes: 0 additions & 32 deletions modules/extras/me-dap-utils.el

This file was deleted.

0 comments on commit bca42ac

Please sign in to comment.