ext/greenwich - Improve portability. Consolidate tasks.
authorTim Otten <totten@civicrm.org>
Thu, 24 Sep 2020 12:03:07 +0000 (05:03 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 24 Sep 2020 12:03:07 +0000 (05:03 -0700)
1. Using 'php-eval' instead of 'shell' should make it safer to run on Windows.

2. The two steps are very closesly related. Putting them into the same 'task'
   means that it's a bit easier to understand the 'watch' behavior.

ext/greenwich/composer.compile.json

index 932659b286879cbcc4b3b71009bd34510eb51566..310523df0c8b0720db38b3beb2ca2b3dac6e1dc5 100644 (file)
@@ -1,14 +1,13 @@
 {
   "compile": [
-    {
-      "title": "Greenwich (Coerce <comment>select2-bootstrap</comment> to SCSS)",
-      "shell": "set -e ; mkdir -p extern/select2 ; cp ../../bower_components/select2/select2-bootstrap.css extern/select2/select2-bootstrap.scss",
-      "watch-files": ["../../bower_components/select2/"]
-    },
     {
       "title": "Greenwich CSS (<comment>dist/bootstrap3.css</comment>)",
-      "php-method": "\\Civi\\Compile\\Scss::build",
-      "watch-files": ["scss", "extern/select2"],
+      "run": [
+        "@php-eval mkdir('extern/select2', 0777, TRUE);",
+        "@php-eval $ok = copy('../../bower_components/select2/select2-bootstrap.css', 'extern/select2/select2-bootstrap.scss'); exit($ok?0:1);",
+        "@php-method \\Civi\\Compile\\Scss::build"
+      ],
+      "watch-files": ["scss", "../../bower_components/select2/select2-bootstrap.css"],
       "scss-files": {"scss/main.scss": "dist/bootstrap3.css"},
       "scss-includes": ["scss", "extern/bootstrap3/assets/stylesheets", "extern/select2"]
     }