1
0
Fork 0

Skip linting the docs when making a change to the root (#484)

It seems that Netlify is having some caching of the git remote and while this PR was working fine when I submitted it, it now fails as it has forgotten which remote to use.

I'm going to go and accept it, in order to group all the code that deals with Netlify in the same branch, allowing me to better have them work together.
This commit is contained in:
Tim Carry 2018-10-08 13:06:06 +02:00 committed by GitHub
parent f4a8b4c586
commit b422effcfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -9,7 +9,7 @@
"lint:css": "./scripts/lint-css",
"lint:md": "./scripts/lint-md",
"lint:md:fix": "./scripts/lint-md-fix",
"prepush": "yarn lint",
"prepush": "./scripts/prepush",
"serve": "babel-node ./scripts/serve.js"
},
"devDependencies": {

13
docs/scripts/prepush Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
git diff --name-status master | grep 'docs/' 1>/dev/null
DOCS_FOLDER_HAS_CHANGED=$?
# We don't run the docs linting if no changes were made in the docs
if [ "$DOCS_FOLDER_HAS_CHANGED" = "1" ]; then
exit 0
fi
yarn run lint:js && \
yarn run lint:css && \
yarn run lint:md