depends-on installs official extensions, 3rd party extensions, elpa packages

This commit is contained in:
amirrezaask 2020-04-04 01:18:56 +04:30
parent 8e622a838e
commit 19323c0d0c
1 changed files with 25 additions and 6 deletions

View File

@ -75,21 +75,40 @@
(when (not fpkg-initilized-p)
(fpkg-initialize)))
(defun get-extension-name (args)
(cond
((symbolp args) args)
((listp args) (car args))))
(defvar official-extensions '(devops-extension))
(defun is-official-extension (args)
(member args official-extensions))
(defun get-official-extension-receipe (name)
(list name :host 'gitlab :repo (format "amirrezaask/%s" name)))
(defun fg42-install-extension (args)
)
(let ((extension-name (get-extension-name args)))
(if (is-official-extension extension-name)
(straight-use-package (get-official-extension-receipe extension-name))
(straight-use-package extension-name))))
(defun extensionp (args)
"Tell if given ARGS is a FG42 extension or a normal straight package."
(cond
((symbolp args) (string= (car (last (split-string (symbol-name args) "-"))) "extension"))
((listp args) (string= (car (last (split-string (symbol-name (car args)) "-"))) "extension"))))
(defmacro depends-on (args)
(defun depends-on (args)
(if (extensionp args)
`(fg42-install-extension ,args)
`(straight-use-package ,args)
))
(fg42-install-extension args)
(straight-use-package args)
))
(fg42-install-extension 'devops-extension)
(provide 'fpkg)
;;; fpkg.el ends here