-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debugging information for check format/format (#112)
- Loading branch information
1 parent
9f0e585
commit 0760457
Showing
3 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
echo "Pulling prettier version from package.json" | ||
EXERCISM_PRETTIER_VERSION=$(npm list prettier | grep -Po '.*prettier@\K.*') | ||
echo "Pulling prettier version from package.json" | ||
EXERCISM_PRETTIER_VERSION=$(yarn list --pattern prettier | grep -Po '.*\sprettier@\K.*') | ||
fi | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
echo "This script requires the EXERCISM_PRETTIER_VERSION variable to work." | ||
echo "Please see https://github.com/exercism/v3/blob/master/docs/maintainers/style-guide.md for guidance." | ||
exit 1 | ||
echo "---------------------------------------------------" | ||
echo "This script requires the EXERCISM_PRETTIER_VERSION variable to work." | ||
echo "Please see https://exercism.org/docs/building/markdown/style-guide for guidance." | ||
echo "---------------------------------------------------" | ||
echo "This is what yarn list reports:" | ||
echo "$(yarn list prettier)" | ||
echo "" | ||
echo "This is the version that can be extracted:" | ||
echo "$(yarn list --pattern prettier | grep -Po '.*\sprettier@\K.*')" | ||
echo "" | ||
echo "These files are found in the repo root:" | ||
echo "$(ls -p | grep -v /)" | ||
echo "---------------------------------------------------" | ||
exit 1 | ||
else | ||
echo "Running format with prettier@$EXERCISM_PRETTIER_VERSION" | ||
echo "Running format with prettier@$EXERCISM_PRETTIER_VERSION" | ||
fi | ||
|
||
npx "prettier@$EXERCISM_PRETTIER_VERSION" --check "**/*.{js,jsx,ts,tsx,css,sass,scss,html,json,md,yml}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
echo "Pulling prettier version from package.json" | ||
EXERCISM_PRETTIER_VERSION=$(npm list prettier | grep -Po '.*prettier@\K.*') | ||
echo "Pulling prettier version from package.json" | ||
EXERCISM_PRETTIER_VERSION=$(yarn list --pattern prettier | grep -Po '.*\sprettier@\K.*') | ||
fi | ||
|
||
if [ -z "$EXERCISM_PRETTIER_VERSION" ]; then | ||
echo "This script requires the EXERCISM_PRETTIER_VERSION variable to work." | ||
echo "Please see https://github.com/exercism/v3/blob/master/docs/maintainers/style-guide.md for guidance." | ||
exit 1 | ||
echo "---------------------------------------------------" | ||
echo "This script requires the EXERCISM_PRETTIER_VERSION variable to work." | ||
echo "Please see https://exercism.org/docs/building/markdown/style-guide for guidance." | ||
echo "---------------------------------------------------" | ||
echo "This is what yarn list reports:" | ||
echo "$(yarn list prettier)" | ||
echo "" | ||
echo "This is the version that can be extracted:" | ||
echo "$(yarn list --pattern prettier | grep -Po '.*\sprettier@\K.*')" | ||
echo "" | ||
echo "These files are found in the repo root:" | ||
echo "$(ls -p | grep -v /)" | ||
echo "---------------------------------------------------" | ||
exit 1 | ||
else | ||
echo "Running format with prettier@$EXERCISM_PRETTIER_VERSION" | ||
echo "Running format with prettier@$EXERCISM_PRETTIER_VERSION" | ||
fi | ||
|
||
npx "prettier@$EXERCISM_PRETTIER_VERSION" --write "**/*.{js,jsx,ts,tsx,css,sass,scss,html,json,md,yml}" |