Skip to content

Commit 080382b

Browse files
authored
fix: Install dep with specific version (#399)
* fix: Install dep with specific version * fix format string with cmd
1 parent 5883dad commit 080382b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

tree-sitter-langs-build.el

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ infrequent (grammar-only changes). It is different from the version of
250250
"List of suffixes for shared libraries that define tree-sitter languages.")
251251

252252
(defconst tree-sitter-langs--langs-with-deps
253-
'( arduino
254-
astro
255-
cpp
256-
commonlisp
257-
hlsl
258-
glsl
259-
toml
260-
typescript)
253+
'((arduino ("[email protected]"))
254+
(astro)
255+
256+
(commonlisp)
257+
(hlsl)
258+
(glsl)
259+
(toml)
260+
(typescript))
261261
"Languages that depend on another, thus requiring `npm install'.")
262262

263263
(defun tree-sitter-langs--bundle-file (&optional ext version os)
@@ -333,9 +333,14 @@ from the current state of the grammar repo, without cleanup."
333333
(:synchronized nil)
334334
(_
335335
(error "Weird status from git-submodule '%s'" status))))
336-
(let ((default-directory dir))
337-
(when (member lang-symbol tree-sitter-langs--langs-with-deps)
336+
(let ((default-directory dir)
337+
(langs-with-deps (mapcar #'car tree-sitter-langs--langs-with-deps))
338+
(cmds (cadr (assoc lang-symbol tree-sitter-langs--langs-with-deps))))
339+
(when (member lang-symbol langs-with-deps)
338340
(tree-sitter-langs--call "npm" "set" "progress=false")
341+
(dolist (cmd cmds)
342+
(with-demoted-errors (concat "Failed to run 'npm install " cmd "': %s")
343+
(tree-sitter-langs--call "npm" "install" cmd)))
339344
(with-demoted-errors "Failed to run 'npm install': %s"
340345
(tree-sitter-langs--call "npm" "install")))
341346
;; A repo can have multiple grammars (e.g. typescript + tsx).

0 commit comments

Comments
 (0)