Skip to content

Commit

Permalink
Merge pull request #52 from tsuyoshicho/feature/npm-command-detect
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshicho authored May 12, 2020
2 parents d78a4ed + 95bb906 commit 91eba0b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ cd "$GITHUB_WORKSPACE"
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

# nothing command, try project package install
if [ ! -f "$(npm bin)/textlint" ]; then
if npm ls textlint &> /dev/null; then
# pass
:
else
npm install
fi
# nothing command in after install, use command direct install
PACKAGE=""
if [ ! -f "$(npm bin)/textlint" ]; then
if npm ls textlint &> /dev/null; then
npx textlint --version
else
PACKAGE="-p textlint@${INPUT_TEXTLINT_VERSION:-11.6.3}"
echo textlint direct install version: ${INPUT_TEXTLINT_VERSION:-11.6.3}
else
npx textlint --version
fi

npx ${PACKAGE} textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-.}" \
Expand Down

0 comments on commit 91eba0b

Please sign in to comment.