mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 22:41:18 +08:00
Summary: The script was moved after the original ShellCheck PR was opened, and this was lost during the rebase. Pull Request resolved: https://github.com/facebook/react-native/pull/21443 Differential Revision: D10133498 Pulled By: hramos fbshipit-source-id: da61b782362ab2d13cb6f0bca3fb1c9a0af08ae5
20 lines
692 B
Bash
Executable File
20 lines
692 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
IFS=$'\n'
|
|
|
|
results=( "$(find . -type f -not -path "*node_modules*" -not -path "*third-party*" -name '*.sh' -exec sh -c 'shellcheck "$1" -f json' -- {} \;)" )
|
|
|
|
cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | node scripts/circleci/code-analysis-bot.js
|
|
|
|
# check status
|
|
STATUS=$?
|
|
if [ $STATUS == 0 ]; then
|
|
echo "Shell scripts analyzed successfully"
|
|
else
|
|
echo "Shell script analysis failed, error status $STATUS"
|
|
fi
|