Skip to content

Commit

Permalink
Merge pull request #10 from StudyTube/story/RAM-2224/custom-styles-li…
Browse files Browse the repository at this point in the history
…nter
  • Loading branch information
yuriykuzin authored Nov 18, 2021
2 parents fe5faf2 + 00117e3 commit a333787
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions hooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ NC='\033[0m'

STYLELINT_CONFIG=.stylelintrc

# Academy monorepo specific: ====================================
CUSTOM_SCSS_VARS_LINT=utils/custom-scss-vars-lint/custom-scss-vars-lint.js

for LXP_PROJECT in academy player
do
PROJECT_PATH=projects/${LXP_PROJECT}

if [ -f "$CUSTOM_SCSS_VARS_LINT" ] && \
[ -d "$PROJECT_PATH" ] && \
[ -n "$(git diff --cached --name-only $PROJECT_PATH)" ]
then
echo "==> Checking custom SCSS variables usage in $PROJECT_PATH";
node $CUSTOM_SCSS_VARS_LINT $LXP_PROJECT

printf "${GREEN}💅 Custom SCSS vars in $LXP_PROJECT are fine!${NC}\n\n"
fi;
done
# end of Academy monorepo specific: =============================

tsfiles=$(git diff --cached --name-only --diff-filter=ACM "*.ts" | tr '\n' ' ')
htmlfiles=$(git diff --cached --name-only --diff-filter=ACM "*.html" | tr '\n' ' ')

Expand Down Expand Up @@ -49,6 +68,13 @@ if [ -n "$e2eScriptsToLint" ]; then
printf "${GREEN}🔨️ E2e scripts are fine!${NC}\n\n"
fi;

if [ -f "$CUSTOM_SCSS_VARS_LINT" ] && [ -d "$ACADEMY_PATH" ] && [ -n "$(git diff --cached --name-only $ACADEMY_PATH)" ]; then
echo "==> Checking custom SCSS variables usage in $ACADEMY_PATH";
node utils/custom-scss-vars-lint/custom-scss-vars-lint.js academy

printf "${GREEN}💅 Custom SCSS vars in Academy are fine!${NC}\n\n"
fi;

if [ -f "$STYLELINT_CONFIG" ] && [ -n "$stylesToLint" ]; then
echo "==> Checking Stylelint errors in staged files";
echo "$stylesToLint" | xargs ./node_modules/.bin/stylelint --fix
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-git-hooks",
"version": "1.0.10",
"version": "1.0.11",
"description": "Storage for git hooks used in Studytube's Angular apps.",
"author": "",
"license": "ISC"
Expand Down

0 comments on commit a333787

Please sign in to comment.