clarified signature: more options;
authorwenzelm
Mon, 08 Sep 2025 23:03:31 +0200
changeset 83115 ee6a594f0e7e
parent 83114 310f1c728ed2
child 83116 e0c85cb6b924
clarified signature: more options;
src/Pure/System/nodejs.scala
--- a/src/Pure/System/nodejs.scala	Mon Sep 08 22:43:15 2025 +0200
+++ b/src/Pure/System/nodejs.scala	Mon Sep 08 23:03:31 2025 +0200
@@ -77,9 +77,13 @@
     def path_setup: String =
       "export PATH=" + Bash.string(platform_context.standard_path(bin_dir)) + """:"$PATH""""
 
-    def install(name: String): Unit = {
+    def install(name: String, production: Boolean = false): Unit = {
       progress.echo("Installing " + name + " ...")
-      Isabelle_System.bash(path_setup + "\nnpm install -g " + Bash.string(name), cwd = path).check
+      Isabelle_System.bash(
+        Library.make_lines(
+          path_setup,
+          "npm install --global " + if_proper(production, "--production ") + Bash.string(name)),
+        cwd = path).check
     }
   }