-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out "esy status" related functions in a separate file
- Loading branch information
1 parent
0f34582
commit 02cba3b
Showing
2 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
;;; esy-core --- core library for minor mode and esy.el. -*- lexical-binding: t; -*- | ||
|
||
;; Copyright (C) 2020 Manas Jayanth | ||
|
||
;; Author: Manas Jayanth <[email protected]> | ||
;; Created: 19 November 2024 | ||
;; Keywords: Reason, OCaml | ||
;; Package-Requires: ((emacs "25.1")) | ||
;; Homepage: http://example.com/foo | ||
|
||
;;; Commentary: | ||
|
||
;;; Change Log: TODO | ||
|
||
;;; Code: | ||
|
||
;; macros | ||
(defmacro esy/macro--with-esy-project (buffer binding-project exp) | ||
`(let ((project (esy/project--of-buffer ,buffer))) | ||
(if (esy/project--p project) | ||
(let ((,binding-project project)) ,exp) | ||
(message "Doesn't look like an esy project. esy-mode will stay dormant")))) | ||
|
||
(defmacro let-esy-project (binding exp) | ||
`(let ((,(car binding) ,(cadr binding))) | ||
(if (esy/project--p ,(car binding)) | ||
,exp | ||
(message "Doesn't look like an esy project. esy-mode will stay dormant")))) | ||
|
||
;;;;;;;;;;;;;;;;;;; esy/status--* defuns ;;;;;;;;;;;;;;;;;;;;;;; | ||
(defun esy/status--get-manifest-file-path (esy-status) | ||
"Given the json object of \'esy status\' output, | ||
it returns the manifest file" | ||
(gethash "rootPackageConfigPath" esy-status)) | ||
|
||
(defun esy/status--dependencies-installed-p (esy-status) | ||
"Given the json object of \'esy status\' output, | ||
it returns if dependencies have been installed." | ||
(gethash "isProjectFetched" esy-status)) | ||
|
||
(defun esy/status--dependency-constraints-solved-p (esy-status) | ||
"Given the json object of \'esy status\' output, | ||
it returns if dependencies have been installed." | ||
(gethash "isProjectSolved" esy-status)) | ||
|
||
(defun esy/status--ready-for-dev-p (esy-status) | ||
"Given the json object of \'esy status\' output, | ||
it returns if dependencies have been installed." | ||
(gethash "isProjectReadyForDev" esy-status)) | ||
|
||
(defun esy/status--project-p (esy-status) | ||
"Given the json object of \'esy status\' output, | ||
it returns if dependencies have been installed." | ||
(gethash "isProject" esy-status)) | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(provide 'esy-core) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters