-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Install dep with specific version (#399)
* fix: Install dep with specific version * fix format string with cmd
- Loading branch information
Showing
1 changed file
with
15 additions
and
10 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 |
---|---|---|
|
@@ -250,14 +250,14 @@ infrequent (grammar-only changes). It is different from the version of | |
"List of suffixes for shared libraries that define tree-sitter languages.") | ||
|
||
(defconst tree-sitter-langs--langs-with-deps | ||
'( arduino | ||
astro | ||
cpp | ||
commonlisp | ||
hlsl | ||
glsl | ||
toml | ||
typescript) | ||
'((arduino ("[email protected]")) | ||
(astro) | ||
(cpp ("[email protected]")) | ||
(commonlisp) | ||
(hlsl) | ||
(glsl) | ||
(toml) | ||
(typescript)) | ||
"Languages that depend on another, thus requiring `npm install'.") | ||
|
||
(defun tree-sitter-langs--bundle-file (&optional ext version os) | ||
|
@@ -333,9 +333,14 @@ from the current state of the grammar repo, without cleanup." | |
(:synchronized nil) | ||
(_ | ||
(error "Weird status from git-submodule '%s'" status)))) | ||
(let ((default-directory dir)) | ||
(when (member lang-symbol tree-sitter-langs--langs-with-deps) | ||
(let ((default-directory dir) | ||
(langs-with-deps (mapcar #'car tree-sitter-langs--langs-with-deps)) | ||
(cmds (cadr (assoc lang-symbol tree-sitter-langs--langs-with-deps)))) | ||
(when (member lang-symbol langs-with-deps) | ||
(tree-sitter-langs--call "npm" "set" "progress=false") | ||
(dolist (cmd cmds) | ||
(with-demoted-errors (concat "Failed to run 'npm install " cmd "': %s") | ||
(tree-sitter-langs--call "npm" "install" cmd))) | ||
(with-demoted-errors "Failed to run 'npm install': %s" | ||
(tree-sitter-langs--call "npm" "install"))) | ||
;; A repo can have multiple grammars (e.g. typescript + tsx). | ||
|