]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: use ${NPM} instead of npm
authorKefu Chai <kchai@redhat.com>
Wed, 21 Jul 2021 02:44:21 +0000 (10:44 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 22 Jul 2021 08:35:47 +0000 (16:35 +0800)
so it is more explicit that ${NPM} is used when NODEENV is not
specified.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/frontend/CMakeLists.txt

index 3d9995b7c5d4b8335c69a9df309f871d5bf2dc7a..9928c0e71983166ba4855d5754b61d32cf4654ee 100644 (file)
@@ -6,7 +6,15 @@ function(add_npm_command)
   cmake_parse_arguments(NC "${options}" "${single_kw}" "${multi_kw}" ${ARGN})
   string(REPLACE ";" " " command "${NC_COMMAND}")
   if(NC_NODEENV)
-    string(REGEX REPLACE "^(.*npm .*)$" ". ${mgr-dashboard-nodeenv-dir}/bin/activate && \\1 && deactivate" command ${command})
+    string(REGEX REPLACE
+      "^(([^ ]+=[^ ]+ )*npm .*)$"
+      ". ${mgr-dashboard-nodeenv-dir}/bin/activate && \\1 && deactivate"
+      command ${command})
+  else()
+    string(REGEX REPLACE
+      "^([^ ]=[^ ] )*npm (.*)$"
+      "\\1${NPM} \\2"
+      command ${command})
   endif()
   string(REPLACE " " ";" command "${command}")
   add_custom_command(