Last active
November 8, 2017 00:48
-
-
Save EdaCZ/10171115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# zkompilovani scss souboru pri komitu | |
# ve zmenenych souborech komitu hledej .scss | |
git diff --cached --name-only | grep '\.scss$' | while IFS= read -r line; | |
do | |
# jen pokud soubor existuje | |
if [ -f ${line} ]; then | |
# zkompilovani na CSS | |
echo " kompilace SCSS: " ${line}; | |
scss --update --force --sourcemap=none --no-cache ${line}; | |
# nahrazeni pripony SCSS za CSS | |
outfile=$(echo ${line} | sed 's/\.scss$/\.css/g') | |
# pridani zkompilovaneho CSS do komitu | |
git add ${outfile} | |
fi | |
done | |
# testy s Nette Testerem | |
git stash -q --keep-index | |
tester | |
RESULT=$? | |
git stash pop -q | |
[ $RESULT -ne 0 ] && exit 1 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment