blob: 0a14d55eb2017d13be7f30723637dc004c581652 [file] [log] [blame]
#!/usr/bin/env sh
confirm () {
if ! eval "$@" ; then
printf "Found some problems in the code. Do you still want to push? [y/N] "
read -r REPLY
if [ "$REPLY" = "${REPLY#[Yy]}" ]
then
echo "Cancelling push..."
exit 1
else
return 1
fi
else
echo "OK!"
fi
}
echo "Checking for ESLint errors and warnings..."
confirm "npm run lint --workspaces -- --max-warnings 0"
if [ $? -eq 1 ]; then
echo "Checking for ESLint errors..."
npm run lint --workspaces -- --quiet
fi
echo "Checking for Prettier problems..."
confirm "npm run format:check --workspaces"