mirror of
https://github.com/NinjaTrappeur/my-repo-pins.git
synced 2024-06-01 19:14:07 +02:00
Commenting WIP work to fix the CI
This commit is contained in:
parent
2a5021274e
commit
97084e560f
60
h.el
60
h.el
|
@ -159,47 +159,47 @@ Returns nil if the repo does not exists."
|
|||
nil)))
|
||||
|
||||
;;; Gitea Fetcher
|
||||
(defun h--query-gitea (instance-url user-name repo-name callback)
|
||||
"Queries the INSTANCE-URL gitea instance to retrieve a repo informations.
|
||||
This function will first try to dertermine whether the
|
||||
USER-NAME/REPO-NAME exists.
|
||||
;; (defun h--query-gitea (instance-url user-name repo-name callback)
|
||||
;; "Queries the INSTANCE-URL gitea instance to retrieve a repo informations.
|
||||
;; This function will first try to dertermine whether the
|
||||
;; USER-NAME/REPO-NAME exists.
|
||||
|
||||
If so, calls the CALLBACK function with a alist containing the ssh and
|
||||
https clone URLs. If the repo does not exists, calls the callback with
|
||||
nil as parameter."
|
||||
(url-retrieve
|
||||
(format "%s/api/v1/repos/%s/%s" instance-url user-name repo-name)
|
||||
(lambda (&rest _rest) (funcall callback (h--fetch-gitea-parse-response(current-buffer))))))
|
||||
; Get /repos/owner/repo
|
||||
;; If so, calls the CALLBACK function with a alist containing the ssh and
|
||||
;; https clone URLs. If the repo does not exists, calls the callback with
|
||||
;; nil as parameter."
|
||||
;; (url-retrieve
|
||||
;; (format "%s/api/v1/repos/%s/%s" instance-url user-name repo-name)
|
||||
;; (lambda (&rest _rest) (funcall callback (h--fetch-gitea-parse-response(current-buffer))))))
|
||||
;; ; Get /repos/owner/repo
|
||||
|
||||
|
||||
;;; Gitlab Fetcher
|
||||
|
||||
(defun h--query-gitlab (instance-url user-name repo-name callback)
|
||||
"Queries the INSTANCE-URL gitlab instance to retrieve a repo informations.
|
||||
This function will first try to dertermine whether the
|
||||
USER-NAME/REPO-NAME exists.
|
||||
;; (defun h--query-gitlab (instance-url user-name repo-name callback)
|
||||
;; "Queries the INSTANCE-URL gitlab instance to retrieve a repo informations.
|
||||
;; This function will first try to dertermine whether the
|
||||
;; USER-NAME/REPO-NAME exists.
|
||||
|
||||
If so, calls the CALLBACK function with a alist containing the ssh and
|
||||
https clone URLs. If the repo does not exists, calls the callback with
|
||||
nil as parameter."
|
||||
(url-retrieve
|
||||
(format "%s/api/v4/users/%s/projects" instance-url user-name)
|
||||
(lambda (&rest _rest) (funcall callback nil))))
|
||||
;1. Find project in
|
||||
;; If so, calls the CALLBACK function with a alist containing the ssh and
|
||||
;; https clone URLs. If the repo does not exists, calls the callback with
|
||||
;; nil as parameter."
|
||||
;; (url-retrieve
|
||||
;; (format "%s/api/v4/users/%s/projects" instance-url user-name)
|
||||
;; (lambda (&rest _rest) (funcall callback nil))))
|
||||
;; ;1. Find project in
|
||||
;https://gitlab.com/api/v4/users/ninjatrappeur/projects
|
||||
|
||||
;;; Generic fetcher infrastructure
|
||||
|
||||
(defun h--dispatch-fetcher (query-string)
|
||||
"Try to download QUERY-STRING via the fetchers registered in ‘h-forge-fetchers’."
|
||||
(cond ((string-match-p "github.com" query-string)
|
||||
(apply 'h--query-github (h--parse-query-string-for-forge query-string)))
|
||||
((string-match-p "gitlab.com" query-string)
|
||||
(apply 'h--query-gitlab (h--parse-query-string-for-forge query-string)))
|
||||
(t (error (format "No fetcher for %s" query-string)))))
|
||||
;; (defun h--dispatch-fetcher (query-string)
|
||||
;; "Try to download QUERY-STRING via the fetchers registered in ‘h-forge-fetchers’."
|
||||
;; (cond ((string-match-p "github.com" query-string)
|
||||
;; (apply 'h--query-github (h--parse-query-string-for-forge query-string)))
|
||||
;; ;; ((string-match-p "gitlab.com" query-string)
|
||||
;; ;; (apply 'h--query-gitlab (h--parse-query-string-for-forge query-string)))
|
||||
;; (t (error (format "No fetcher for %s" query-string)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Internal: repo URI parser
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
|
Loading…
Reference in a new issue