]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
node-sass workflow: improve error message when Sass vars are found (#38448)
authorJulien Déramond <juderamond@gmail.com>
Thu, 13 Apr 2023 06:47:56 +0000 (08:47 +0200)
committerGitHub <noreply@github.com>
Thu, 13 Apr 2023 06:47:56 +0000 (09:47 +0300)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
.github/workflows/node-sass.yml
.gitignore

index d83e3e70f7108b2009e823bfae216d899dec6be8..c558e447af58e5c0d15731183238e14fd3403539 100644 (file)
@@ -35,14 +35,15 @@ jobs:
           npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/
           ls -Al dist-sass/css
 
-      # Check that there are no Sass variables (`$`)
-      - name: Check built CSS files
+      - name: Check built CSS files for Sass variables
         shell: bash
         run: |
-          if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
-            echo "All good, no Sass variables found"
+          SASS_VARS_FOUND=$(find "dist-sass/css/" -type f -name "*.css" -print0 | xargs -0 --no-run-if-empty grep -F "\$" || true)
+          if [[ -z "$SASS_VARS_FOUND" ]]; then
+            echo "All good, no Sass variables found!"
             exit 0
           else
-            echo "Found Sass variables!"
+            echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:"
+            echo "$SASS_VARS_FOUND"
             exit 1
           fi
index 2215d636addfc6b114c3683dd104aefc4e1eace1..0c9b6f55651cc65a79adfbcbb08790819bade60c 100644 (file)
@@ -38,5 +38,6 @@ Thumbs.db
 *.komodoproject
 
 # Folders to ignore
+/dist-sass/
 /js/coverage/
 /node_modules/