mirror of https://github.com/twbs/bootstrap.git
node-sass workflow: improve error message when Sass vars are found (#38448)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
parent
b4befee506
commit
5e3dc587af
|
@ -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/
|
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
|
ls -Al dist-sass/css
|
||||||
|
|
||||||
# Check that there are no Sass variables (`$`)
|
- name: Check built CSS files for Sass variables
|
||||||
- name: Check built CSS files
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
|
SASS_VARS_FOUND=$(find "dist-sass/css/" -type f -name "*.css" -print0 | xargs -0 --no-run-if-empty grep -F "\$" || true)
|
||||||
echo "All good, no Sass variables found"
|
if [[ -z "$SASS_VARS_FOUND" ]]; then
|
||||||
|
echo "All good, no Sass variables found!"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Found Sass variables!"
|
echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:"
|
||||||
|
echo "$SASS_VARS_FOUND"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -38,5 +38,6 @@ Thumbs.db
|
||||||
*.komodoproject
|
*.komodoproject
|
||||||
|
|
||||||
# Folders to ignore
|
# Folders to ignore
|
||||||
|
/dist-sass/
|
||||||
/js/coverage/
|
/js/coverage/
|
||||||
/node_modules/
|
/node_modules/
|
||||||
|
|
Loading…
Reference in New Issue