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:
parent
f4a8b4c586
commit
b422effcfa
2 changed files with 14 additions and 1 deletions
|
|
@ -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
13
docs/scripts/prepush
Executable 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
|
||||
Loading…
Reference in a new issue